This is the mail archive of the gcc@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]

Re: A bug (?) with inline functions at O0: undefined reference


On Fri, Mar 06, 2015 at 07:12:48PM +0300, Ilya Verbin wrote:
> Hi All,
> 
> I've discovered a strange behaviour on trunk gcc, here is the reproducer:
> 
> inline int foo ()
> {
>   return 0;
> }
> 
> int main ()
> {
>   return foo ();
> }
> 
> $ gcc main.c
> /tmp/ccD1LeXo.o: In function `main':
> main.c:(.text+0xa): undefined reference to `foo'
> collect2: error: ld returned 1 exit status
> 
> Is this a bug?  If yes, is it known?
> GCC 4.8.3 works fine though.

Not a bug, just different inline semantics now that the default is
gnu11.  See https://gcc.gnu.org/gcc-5/porting_to.html for more info.

	Marek


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