Informix Error -4054
-4054 Function "name" has already been declared with a different return type.
The function that is described in this FUNCTION statement has already been declared, and the previous declaration disagrees with this one in the number or type of returned values. Review included files for declarations of this function, and make those statements consistent.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-4054 fires when a function is declared again with a different number or type of returned values than its earlier declaration — per the official guidance, the previous declaration disagrees with this one on returned values.
- A function redeclared with a different return count or type than its earlier declaration, per the official guidance — the direct, only cause.
Solutions / Resolution
- Review included files for declarations of this function, per the official guidance.
- Make those statements consistent, per the official guidance.
Examples
Conflicting return types
FUNCTION save(id INTEGER) RETURNING INTEGER
...
FUNCTION save(id INTEGER) RETURNING CHAR(10)
-- -4054: return types disagree
Corrected
FUNCTION save(id INTEGER) RETURNING INTEGER
Diagnostic Checks
- Check all declarations of the function across the module and its included files, and make the return types consistent.
Related Errors / Related Topics
- -4053 — "Function "name" has already been declared with a different prototype." A related function-redeclaration error, about the argument list disagreeing rather than the return type.
A function's declarations disagree on return count or type — make them consistent.