attribute mode is unknown (Sun cc)
Torbjorn Granlund
tg at gmplib.org
Mon Nov 8 09:00:33 CET 2010
Jay K <jay.krell at cornell.edu> writes:
"gmp-impl.h", line 2812: warning: attribute "mode" is unknown, ignored
"gmp-impl.h", line 2812: warning: attribute parameter "QI" is undefined
"gmp-impl.h", line 2813: warning: attribute "mode" is unknown, ignored
"gmp-impl.h", line 2813: warning: attribute parameter "SI" is undefined
"gmp-impl.h", line 2814: warning: attribute "mode" is unknown, ignored
"gmp-impl.h", line 2814: warning: attribute parameter "SI" is undefined
"gmp-impl.h", line 2815: warning: attribute "mode" is unknown, ignored
"gmp-impl.h", line 2815: warning: attribute parameter "DI" is undefined
"gmp-impl.h", line 2816: warning: attribute "mode" is unknown, ignored
"gmp-impl.h", line 2816: warning: attribute parameter "DI" is undefined
cc -V
cc: Sun C 5.9 SunOS_sparc Patch 124867-16 2010/08/11
usage: cc [ options] files. Use 'cc -flags' for details
uname -a
SunOS current9s 5.9 Generic_Virtual sun4u sparc SUNW,SPARC-Enterprise-T5220
OK, so have Oracle added some incompatible variant of GMP's attribute
extension? Or is this some non-standard compiler from Oracle?
diff -u -r1.5 gmp-impl.h
--- gmp-impl.h 5 Nov 2010 11:45:44 -0000 1.5
+++ gmp-impl.h 6 Nov 2010 16:57:29 -0000
@@ -2808,7 +2808,7 @@
/* Define stuff for longlong.h. */
-#if HAVE_ATTRIBUTE_MODE
+#if HAVE_ATTRIBUTE_MODE && defined(__GNUC__)
typedef unsigned int UQItype __attribute__ ((mode (QI)));
typedef int SItype __attribute__ ((mode (SI)));
typedef unsigned int USItype __attribute__ ((mode (SI)));
The correct fix for this is to tweak the feature test for
HAVE_ATTRIBUTE_MODE, leaving it undefined for compilers that do ot
really support it.
--
Torbjörn
More information about the gmp-bugs
mailing list