The C language allows you to read the source files in one pass, without hesitation; at some point, the compiler should only consider declarations, prototypes, macro descriptions, etc., that appeared before its current position in the file.
Does this mean that calling a call function to the compiler may require the function to be defined before the call? For instance:
int foo(void); int bar(void) { return foo(); } inline int foo(void) { return 42; }
Is it possible for the foo call to be inline if the inline definition is moved before the bar definition?
Do I have to organize inline definitions in my code so that they appear before the calls that should be inline best? Or can I just assume that any optimizing compiler advanced enough to make an attachment at all can find the definition even if it appears after the call (which is similar to gcc)?
EDIT: I noticed that in Pelles C with the /Ob1 really requires the definition to be visible before the call can be embedded. The compiler also offers the /Ob2 , which removes this restriction (and also allows the compiler to embed functions without a built-in specifier, similar to what gcc does), but the documentation states that using this second option may require much more memory.
source share