This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-declarations


"John Fisher" <john.fisher@nec.com.au> writes:

> Is it necessary to specify all 4 of these warnings to get the maximum amount
> of warnings in C code?

Probably not.

> I would expect that -Wmissing-prototypes implies -Wmissing-declarations
> since I understand
> prototype to mean exactly "new-style function declaration".

-Wmissing-prototypes warns about

void f ();
void f (int i) { }

(i.e., there is no previous declaration with a prototype).

-Wmissing-declarations normally warns about

void f (int i) { }

(i.e., there is no previous declaration at all) which is a subset of
-Wmissing-prototypes.

I can't think of any case where -Wmissing-declarations will give a
warning but -Wmissing-prototypes will not.  There is what appears to
be such a case in the compiler source code, but I don't see any way to
trigger it with a valid program.

Ian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]