Error on implicit function definition?

Robert Krawitz rlk@torrent.com
Tue Oct 27 14:55:00 GMT 1998


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



More information about the Gcc mailing list