This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/41471] New: inline function calling inline function causes undef with -std=c99
- From: "sje at cup dot hp dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 25 Sep 2009 19:52:00 -0000
- Subject: [Bug c/41471] New: inline function calling inline function causes undef with -std=c99
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
If I compile this test case with -std=c99 and no optimization, I get an
undefined external. It seems to happen on all platforms including x86 Linux.
Removing the -std=c99 or using optimization will make the error go away.
$ cat f.c
inline int foo() { return 123; }
inline int goo() { return foo(); }
int main() { return goo(); }
$ gcc -O0 -std=c99 f.c -o x
/tmp/cc4dBeMk.o: In function `main':
f.c:(.text+0xa): undefined reference to `goo'
collect2: ld returned 1 exit status
--
Summary: inline function calling inline function causes undef
with -std=c99
Product: gcc
Version: 4.5.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: sje at cup dot hp dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41471