Discussion:
-Wstrict-prototypes warn twice about function declaration ?
Nicolas Joly
2012-06-24 16:57:39 UTC
Permalink
Hi,

While checking some code, it noticed that `-Wstrict-prototypes' warn
twice about function declaration ... first for the declaration itself,
and once again for the definition even if correct.

***@lanfeust [~]> cat strict.c
int foo();
int foo(void) { return 0; }
***@lanfeust [~]> pcc -Wstrict-prototypes -c strict.c
strict.c:1: warning: function declaration isn't a prototype
strict.c:2: warning: function declaration isn't a prototype

Here, i would have expected only a single warning for the declaration
(line 1), but not for the definition (line 2).

Not sure if this is the right fix, but the attached patch make it
work as i would have expected.

***@lanfeust [~]> pcc -Wstrict-prototypes -c strict.c
strict.c:1: warning: function declaration isn't a prototype

Thanks.
--
Nicolas Joly

Projects and Developments in Bioinformatics
Institut Pasteur, Paris.
Loading...