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

Error on implicit function definition?


Is there an option to take an error (rather than merely warn) on
implicit function definition?  The fact that g++ and egcs merely warn
without taking an error causes us considerable annoyance, since it
means that g++ accepts code that other compilers don't.

a()
{
  foo();
}

g++ -Wall -c implicit.c -ansi -pedantic-errors
implicit.c: In function `int a()':
implicit.c:2: return-type defaults to `int'
implicit.c:3: implicit declaration of function `int foo(...)'
implicit.c:4: warning: control reaches end of non-void function `a()'

-- 
Robert Krawitz <rlk@torrent.com>		     Founding Engineer
Torrent Systems Inc.				      617-354-8484x104


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