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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"John Fisher" <john.fisher@xxxxxxxxxx> 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 of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux