------- Comment #7 from fxcoudert at gcc dot gnu dot org  2007-01-30 13:45 
-------
(In reply to comment #5)
> CVS mingw runtime header _mingw.h has this, which avoids the problem:
> 
> # if ( __MINGW_GNUC_PREREQ(4, 3)  && __STDC_VERSION__ >= 199901L)
> #  define __CRT_INLINE extern inline __attribute__((__gnu_inline__))
> # else
> #  define __CRT_INLINE extern __inline__
> # endif

Hum, here's what I don't understand. I installed the w32api-3.8, that includes
the above, and I still get a failure (this is on a cross from i386-linux):

$ ./bin/i386-pc-mingw32-gcc a.c b.c -std=c99 
/tmp/ccR36DmT.o:b.c:(.text+0x0): multiple definition of `___fpclassifyl'
/tmp/cc03idRc.o:a.c:(.text+0x0): first defined here
[... more of those ...]

So I look into the preprocessed files, and ___fpclassifyl is declared as:

extern __attribute__((__gnu__inline__)) inline int __attribute__((__cdecl__))
__fpclassifyl (long double x){
  unsigned short sw;
  __asm__ ("fxam; fstsw %%ax;" : "=a" (sw): "t" (x));
  return sw & (0x0100 | 0x0400 | 0x4000 );
}

so I reproduce it on a minimal testcase:

$ cat u1.c 
extern __attribute__((__gnu__inline__)) inline void __attribute__((__cdecl__))
__fpclassifyl (){
  ;
}

void foo() { ; }
$ cat u2.c 
extern __attribute__((__gnu__inline__)) inline void __attribute__((__cdecl__))
__fpclassifyl (){
  ;
}

void bar() { ; }
$ ./bin/i386-pc-mingw32-gcc -std=c99 u1.c u2.c 
u1.c:1: warning: ‘__gnu__inline__’ attribute directive ignored
u2.c:1: warning: ‘__gnu__inline__’ attribute directive ignored
/tmp/ccni42ym.o:u2.c:(.text+0x0): multiple definition of `___fpclassifyl'
/tmp/cc2aaPle.o:u1.c:(.text+0x0): first defined here
/home/fxcoudert/cross_nightbuild/tmp/install-gcc/lib/gcc/i386-pc-mingw32/4.3.0/../../../../i386-pc-mingw32/lib/libmingw32.a(main.o):main.c:(.text+0x106):
undefined reference to [EMAIL PROTECTED]'
collect2: ld returned 1 exit status


PS: all this is with mainline rev. 121280, Last Changed Date: 2007-01-29
06:53:40 +0100 (Mon, 29 Jan 2007).


-- 


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

Reply via email to