Re:Forward Referencing in C
by camel-cdr on Monday June 05, 2023 @06:05AM
(#36194359)
Isn't it common knowledge that c89 has implicit function declarations?
Here the the relevant standard quote:
If the expression that precedes the parenthesized argument list in a function call consists solely of an identifier, and if no declaration is visible for this identifier, the identifier is implicitly declared exactly as if, in the innermost block containing the function call, the declaration
extern int identifier();
appeared
Re:Forward Referencing in C
by fanf2 on Monday June 05, 2023 @06:09AM
(#36194390)
Right. And in the example, the function definition does not match the implicit definition, so it is undefined behaviour. (The calling conventions may differ.)
Here the the relevant standard quote: