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/41471] New: inline function calling inline function causes undef with -std=c99


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


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