Sun Studio 12 .. just for the heck of it ( again )

Dennis Clarke dclarke at
Mon Feb 20 16:29:15 CET 2012

> Dennis Clarke <dclarke at> writes:
>   Same as with this :
>   Sun Studio 12 simply will not compile GMP 5.0.4 and fails when it hits
> and needs to grok attribute malloc. Well the feature list at :
>   clearly says "Additions to the __attributes__ clause: always_inline,
> noinline,
>   pure, const, malloc, and aligned" are supported on Studio 12 and Studio 12
>   Update 1.
> Do the other attribute args work?  Perhaps there is a command line
> option for switching on and off attribute arg recognition?

Well, it turns out that config.h helps with :

/* Define to 1 if the compiler accepts gcc style __attribute__ ((malloc)) */

then in gmp-impl.h we see :

/* "malloc" means a function behaves like malloc in that the pointer it
   returns doesn't alias anything.  */
#define ATTRIBUTE_MALLOC  __attribute__ ((malloc))

So I can just -DHAVE_ATTRIBUTE_MALLOC=1 at which point configure goes
off into never never land to never return when it tries to check for
a C++ compiler. No really .. I watched for ten minutes as it got all
chewed up and stuck on a simple test. Be damned if I know why.

> It always creates headache when vendors of non-free compilers try to
> become GCC compatible.  Remember that Intel decided to define __GNUC__
> in their 'icc' compiler?

eek .. and of course they, in return, love to wave at C99 standards
and ISO/IEC 9899 and away we go into never never land as opposed to
solving the problem.

> (I don't plan to work on this problem, but I will applause others that
> do.)

I'm just trying to stare it down at the moment. Thus far I have
blinked twice. At least.

I'll get you some gmpbence results for a Niagara T5220 as soon as I
get over these little issues and just use GCC 4.6.2.


| Dennis Clarke           | Solaris and Linux and Open Source |
| dclarke at   | Respect for open standards.       |

More information about the gmp-bugs mailing list