[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#450746: gcc: Generates extnernal references for static variable.



On Fri, Nov 23, 2007 at 09:28:36AM +0100, Matthias Klose wrote:
> Kurt Roeckx writes:
> > Package: gcc-4.2
> > Version: 4.2.2-3
> > 
> > Hi,
> > 
> > This program:
> > static int foo();
> > int bar() { foo(); }
> > 
> > When being compiled generates a warning:
> > tst.c:1: warning: 'foo' used but never defined
> > 
> > And it actually creates an reference to an extneral symbol, just like
> > static wasn't there.
> > 
> > $ nm tst.o
> > 0000000000000000 T bar
> >                  U foo
> > 
> > 
> > Please turn this into an error.
> 
> why? you did declare foo, but didn't define it.

Exactly.  And it's static.  It shouldn't go and find it some other
file.


Kurt





Reply to: