[Bug c/55965] New: gcc -std=c99 emits code for inline even without extern

jeremyhu at macports dot org gcc-bugzilla@gcc.gnu.org
Mon Jan 14 04:44:00 GMT 2013


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55965

             Bug #: 55965
           Summary: gcc -std=c99 emits code for inline even without extern
    Classification: Unclassified
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: jeremyhu@macports.org


$ cat /tmp/testa.c 
inline int isalnum(int _c) { return 1; }
inline int _isalnum(int _c) { return 1; }

$ /opt/local/bin/gcc-mp-4.8 -c /tmp/testa.c -o /tmp/test.o -std=c99

$ nm /tmp/test.o 
0000000000000010 s EH_frame1
0000000000000000 T _isalnum

---

isalnum is being emitted with external linkage even though it is inline and
never declared as 'extern inline'  It looks like gcc may have implicit extern
declarations for some functions which is forcing this 'inline' definition to be
treated asn an 'extern inline' definition.



More information about the Gcc-bugs mailing list