Here's the source code: extern inline void f() {} int main () {} Compile with gcc -c -std=gnu99 filename.c Use nm filename.o to see that a global symbol f has been declared, but it shouldn't be. This prevents libgmp from being usable under Mac OS 10.5. % uname -a Darwin indigo.local 9.1.0 Darwin Kernel Version 9.1.0: Wed Oct 31 17:46:22 PDT 2007; root:xnu-1228.0.2~1/RELEASE_I386 i386
Well extern inline for 4.3.0 and before in C99 mode was the GNU 89 extern inline and not the C99 extern inline. This was fixed for 4.3.0.
Well, if you were right, then gnu99 and gnu89 would have the same behavior, but they don't: indigo% gcc -c -std=gnu99 foo.c indigo% nm foo.o 00000000 T _f 00000008 T _main indigo% gcc -c -std=gnu89 foo.c indigo% nm foo.o 00000000 T _main indigo% gcc -v Using built-in specs. Target: i686-apple-darwin9 Configured with: /var/tmp/gcc/gcc-5465~16/src/configure --disable-checking -enable-werror --prefix=/usr --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-transform-name=/^[cg][^.-]*$/s/$/-4.0/ --with-gxx-include-dir=/include/c++/4.0.0 --with-slibdir=/usr/lib --build=i686-apple-darwin9 --with-arch=apple --with-tune=generic --host=i686-apple-darwin9 --target=i686-apple-darwin9 Thread model: posix gcc version 4.0.1 (Apple Inc. build 5465)
PS: it could be a bug inserted by Apple...
> Use nm filename.o to see that a global symbol f has been declared, but it >shouldn't be. Yes it should, that is what it should do for C99/GNU99. >PS: it could be a bug inserted by Apple... Well no, Apple just fixed extern inline for C99 mode for their 4.0.x compiler. So GMP has issues with its source not being C99 compatible even though it uses -std=gnu99 .
Thank you!
Update your gmp, this was fixed in 4.2.2. > Well, if you were right, then gnu99 and gnu89 would have the same behavior, but > they don't: gnu99 behaves like c99.