This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: [Bug c/39026] New: Gcc accepts invalid code
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: hjl dot tools at gmail dot com <gcc-bugzilla at gcc dot gnu dot org>
- Cc: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 29 Jan 2009 20:02:14 +0000 (UTC)
- Subject: Re: [Bug c/39026] New: Gcc accepts invalid code
- References: <bug-39026-682@http.gcc.gnu.org/bugzilla/>
On Thu, 29 Jan 2009, hjl dot tools at gmail dot com wrote:
> inline void foo ();
>
> int
> main ()
> {
> foo ();
> return 0;
> }
> [hjl@gnu-6 gcc]$ gcc /tmp/i.i -S
If you use -std=c99 -pedantic-errors you get an error, as expected.
You're compiling in gnu89 mode.
If you use -std=c99 without -pedantic-errors you get a duplicate warning:
t.c:1: warning: inline function 'foo' declared but never defined
t.c:1: warning: inline function 'foo' declared but never defined
--
Joseph S. Myers
joseph@codesourcery.com