Informix Error -4111: Warning: The function name is declared informally. For stronger type checking, use a function defined formally.
Cause and resolution
Warning: The function name is declared informally. For stronger type checking, use a function defined formally.
The compiler detected that function name is an informal function. Possibly the function returned a different number of arguments in different circumstances, or the function has no prototype declaration. Although nothing is wrong with defining a function this way, informal functions are more prone to errors at runtime. It is recommended that you use formal function declarations (along with function prototypes) that are less error-prone and that the compiler checks more rigorously.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-4111 is a compiler warning: per the official guidance, the compiler detected an informal function — possibly one returning different numbers of arguments in different circumstances, or one with no prototype declaration. Informal functions aren't inherently wrong, but they're more prone to runtime errors than formally-declared ones.
- A function used without a formal prototype declaration, per the official guidance — the direct cause; not itself an error.
Solutions / Resolution
- Use formal function declarations with prototypes, per the official guidance, since they're less error-prone and checked more rigorously by the compiler.
Examples
An informal function
FUNCTION save(id)
...
END FUNCTION
Corrected, declared formally
FUNCTION save(id INTEGER) RETURNING INTEGER
...
END FUNCTION
Diagnostic Checks
- Check whether the flagged function has a formal prototype declaration, and add one for stronger compile-time type checking.
Related Errors / Related Topics
No closely related error codes are cross-referenced for -4111 in this set yet.
A function is declared informally — add a formal declaration with a prototype for stronger type checking.