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++/41194] __attribute__ ((__gnu_inline__)) yields undefined reference when compiled with -O0, but not with -O1



------- Comment #3 from jonny+bg at mail dot hfa3 dot org  2010-05-31 23:41 -------
For clarity, a smaller test is:  __inline __attribute__ ((gnu_inline)) void
func () { } int main() { func(); return 0; }  $ g++ foo.cpp /tmp/cc31L8fw.o: In
function `main': foo.cpp:(.text+0x5): undefined reference to `func()' collect2:
ld returned 1 exit status  Most people who hit this bug are likely using gperf.
 $ gperf -N func  . . . #ifdef __GNUC__ __inline #if defined
__GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__ __attribute__
((__gnu_inline__)) #endif #endif const char * func (str, len) . . .  $ gperf -N
func -L C++ # will and avoid this bug :-) but also renames func to
Perfect_Hash::func :-(


-- 


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


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