Article View: gnu.gcc.bug
Article #6135Re: #include not working right?
From: Andreas Schwab
Date: Fri, 06 Dec 1996 00:00
Date: Fri, 06 Dec 1996 00:00
33 lines
1914 bytes
1914 bytes
Matt Stainforth <mbs@paladine.moncton.nbcc.nb.ca> writes:
|> Does anyone know why this is happening?
|> # gcc -c ping.c -o ping.o
|> # gcc ping.o -o ping -L../lib -linet6 -lresolv
|> ping.o: In function `main':
|> ping.o(.text+0x7c0): undefined reference to `clear_bit'
|> ping.o(.text+0x7d1): undefined reference to `clear_bit'
|> ping.o(.text+0x7e2): undefined reference to `clear_bit'
|> ping.o(.text+0x7f3): undefined reference to `clear_bit'
|> ping.o(.text+0x807): undefined reference to `clear_bit'
|> This is clear_bit which is defined in <asm/bitops.h>, which is included:
|> extern __inline__ int clear_bit(int nr, void * addr)
|> {
|> int oldbit;
|> __asm__ __volatile__(""
|> "btrl %2,%1\n\tsbbl %0,%0"
|> :"=r" (oldbit),"=m" ((*(struct __dummy *) addr) )
|> :"ir" (nr));
|> return oldbit;
|> }
You are not optimizing, so inlining is not performed. Because clear_bit
is declared extern, no non-inline version is generated either. So either
enable the optimizer or provide a non-inline definition of clear_bit (for
example, by changing extern to static).
--
Andreas Schwab "And now for something
schwab@issan.informatik.uni-dortmund.de completely different"
Technical Details
Message-ID:
<vyziv6gasah.fsf@issan.informatik.uni-dortmund.de>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<58777c$g66@agate.nbnet.nb.ca>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 113d02,bda5bcd29824021b X-Google-Attributes: gid113d02,public From: schwab@issan.informatik.uni-dortmund.de (Andreas Schwab) Subject: Re: #include not working right? Date: 1996/12/06 Message-ID: <vyziv6gasah.fsf@issan.informatik.uni-dortmund.de> X-Deja-AN: 202662989 sender: schwab@issan.informatik.uni-dortmund.de references: <58777c$g66@agate.nbnet.nb.ca> organization: Dortmund University, Germany x-gateway: relay7.UU.NET from bug-gcc to gnu.gcc.bug; Fri, 6 Dec 1996 05:20:43 EST newsgroups: gnu.gcc.bug