This is the mail archive of the gcc-bugs@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]

Re: -Wmissing-prototypes is broken



  In message <Pine.GSO.4.03.9809091740200.24901-100000@markab.dbai.tuwien.ac.at
>you write:
  > The docs say
  > 
  >   -Wmissing-prototypes'
  >      Warn if a global function is defined without a previous prototype
  >      declaration.  This warning is issued even if the definition itself
  >      provides a prototype.  The aim is to detect global functions that
  >      fail to be declared in header files.
  > 
  > but even for the trivial program
  > 
  >   void f(int i) {
  >       i++;
  >       }
  > 
  > it does not seem to work like that:
Seems to work for me:


gcc -Wmissing-prototypes foo.c -c
foo.c:1: warning: no previous prototype for `f'
[law@ralph /usr/tmp/egcs/gcc] gcc -v
Reading specs from /usr/egcs/lib/gcc-lib/i686-pc-linux-gnu/egcs-2.91.57/specs
gcc version egcs-2.91.57 19980901 (egcs-1.1 release)

I also get the error with the mainline sources.

jeff


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