configure script doesn't detect __attribute__((mode(SI))) correctly

Roland Illig roland.illig at gmx.de
Sun Nov 25 09:30:41 CET 2007


I tried to compile gmp on Solaris, using the sunpro 12 compiler.

This compiler has begun to support the __attribute__ keyword from gcc, 
but the support is not yet complete. The attribute is accepted 
syntactically, but ignored for certain values:

"../gmp-impl.h", line 2810: warning:  attribute "mode" is unknown, ignored
"../gmp-impl.h", line 2810: warning: attribute parameter "QI" is undefined
"../gmp-impl.h", line 2811: warning:  attribute "mode" is unknown, ignored
"../gmp-impl.h", line 2811: warning: attribute parameter "SI" is undefined
"

The GMP configure script should be fixed to check whether 
__attribute__((mode)) is really supported or just syntactically 
accepted. I used the following program for it:

typedef int SItype __attribute__ ((mode (SI)));
typedef int QItype __attribute__ ((mode (QI)));
int
main ()
{
   switch (1) {
   case sizeof(SItype):
   case sizeof(QItype):
   ;
   }
   return 0;
}

It works both with gcc and with sunpro, failing with a "duplicate case 
label" error if the two types are of the same size, which they shouldn't be.

Roland
-------------- next part --------------
A non-text attachment was scrubbed...
Name: acinclude.m4.patch
Type: text/x-patch
Size: 658 bytes
Desc: not available
Url : http://gmplib.org/list-archives/gmp-bugs/attachments/20071125/34813d6a/attachment.bin 


More information about the gmp-bugs mailing list