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]
Other format: [Raw text]

[Bug c/39026] Gcc accepts invalid code



------- Comment #4 from rguenther at suse dot de  2009-01-29 21:24 -------
Subject: Re:  Gcc accepts invalid code

On Thu, 29 Jan 2009, joseph at codesourcery dot com wrote:

> 
> 
> ------- Comment #2 from joseph at codesourcery dot com  2009-01-29 20:02 -------
> Subject: Re:   New: Gcc accepts invalid code
> 
> 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

I think the frontend should, in C89 mode and if just issueing a warning,
set DECL_EXTERNAL properly on the decl.

Richard.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39026


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