Error on implicit function definition?
Robert Krawitz
rlk@torrent.com
Wed Oct 28 20:18:00 GMT 1998
Date: Wed, 28 Oct 1998 21:49:15 +0100
From: Martin von Loewis <martin@mira.isdn.cs.tu-berlin.de>
> Is there an option to take an error (rather than merely warn) on
> implicit function definition?
With -pedantic, this is an error.
No, it's not:
[2(rlk)||{!1742}<tertis.torrent.com>/tmp]
% cat implicit.C
a()
{
foo();
}
[2(rlk)||{!1743}<tertis.torrent.com>/tmp]
% g++ -v
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.57/specs
gcc version egcs-2.91.57 19980901 (egcs-1.1 release)
[2(rlk)||{!1744}<tertis.torrent.com>/tmp]
% g++ -pedantic -c implicit.C
implicit.C: In function `int a()':
implicit.C:3: warning: implicit declaration of function `int foo(...)'
implicit.C:4: warning: control reaches end of non-void function `a()'
[2(rlk)||{!1745}<tertis.torrent.com>/tmp]
% echo $status
0
--
Robert Krawitz <rlk@torrent.com> Founding Engineer
Torrent Systems Inc. 617-354-8484x104
More information about the Gcc
mailing list