Bruno Haible <br...@clisp.org> writes: > According to my understanding of C99, > - foo() as a function _definition_ defines a function with 0 arguments, > not with varargs. (Things are different for a function _declaration_ > without a body.)
Yes. > - There is no reason for GCC to warn about foo(). Probably Eric is using -Wstrict-prototypes: `-Wstrict-prototypes (C and Objective-C only)' Warn if a function is declared or defined without specifying the argument types. (An old-style function definition is permitted without a warning if preceded by a declaration which specifies the argument types.) -Wstrict-prototypes is useful for finding foo()-style declarations (especially in header files) to remind the programmer to change them to foo(void) prototypes, so that callers cannot inadvertently invoke them with one or more arguments. -Wstrict-prototypes is less useful for the main function, since it is rarely invoked directly by other program code. -- Ben Pfaff http://benpfaff.org