__attribute__ ((mode (XX))) incorrectly determined by autoconf.

Andreev Konstantin andreev at swemel.ru
Tue Jun 23 14:17:09 CEST 2009


Hello, Vincent.

I do not know autoconf so well to suggest particular way. 

I just noticed this comment in acinclude.m4:

dnl  GMP_C_ATTRIBUTE_MALLOC
dnl  ----------------------
dnl  gcc 2.95.x accepts __attribute__ ((malloc)) but with a warning that it's ignored.

That's what is desirable for "__attribute__ ((mode (XX)))" also.

Best regards,
--
Konstantin Andreev.


On Tue, 23/06/2009 13:49 +0200, Vincent Lefevre wrote:
> On 2009-06-23 14:48:49 +0400, Andreev Konstantin wrote:
> > Autoconf script incorrectly determines working "__attribute__ ((mode (SI)))" for "SunStudio Express 2009/03" compiler:
> > 
> > [andreev at jabba gmp-4.3.1]$ cc -V
> > cc: Sun Ceres C 5.10 SunOS_i386 2009/03/06
> > [andreev at jabba gmp-4.3.1]$ echo 'typedef int SItype __attribute__ ((mode (SI)));' >test.c
> > [andreev at jabba gmp-4.3.1]$ cc -c test.c
> > "test.c", line 1: warning:  attribute "mode" is unknown, ignored
> > "test.c", line 1: warning: attribute parameter "SI" is undefined
> > [andreev at jabba gmp-4.3.1]$ echo $?
> > 0
> > 
> > I suppose, in your acinclude.m4 you should use the same technique for "__attribute__ ((mode (SI)))" as for "__attribute__ ((malloc))" to detect warning about ignored attribute.
> 
> Do you mean
> 
>   gmp_compile="$CC $CFLAGS $CPPFLAGS -c conftest.c >conftest.out 2>&1"
>   if AC_TRY_EVAL(gmp_compile); then
>   [...]
> 
> instead of AC_TRY_COMPILE?
> 
> Note that MPFR would be affected too since it uses the same method as GMP.
> 
> Regards,


More information about the gmp-bugs mailing list