implicit void arguments not checked?
Ian Lance Taylor
iant@google.com
Thu Jul 13 15:48:00 GMT 2006
florin@iucha.net (Florin Iucha) writes:
> 1. Shouldn't gcc at least warn about greet being called with and argument
> that is not present in the declaration?
No. In C, "void fn()" means that you are not saying anything about
the arguments accepted by the function. As you mentioned, the way to
say that a function takes no arguments is "void fn(void)".
> 2. What -W option should I use to get the warning (if it is not by
> default in Wall)?
-Wstrict-prototypes
Ian
More information about the Gcc-help
mailing list