attribute mode is unknown (Sun cc)

Jay K jay.krell at
Mon Nov 8 12:42:12 CET 2010

>   What is the #else clause for?
> An attempt to get the right-sized types that works most of the time,
> but it assumes e.g. that "unsigned long" is 32 bits.
> (It is not at all pretty, and this code predates GMP's use of autoconf;
> we should be able to get these things more neatly fusing autoconf.)
> -- 
> Torbjörn

Eek, scary, long is so often 64bits these days.
Testing the values from limits.h can be pretty good.

Of course, int is almost always 32 bits..

Can you tell me more precisely about the rest of the block?

So I can patch our copy?

I'm very willing to live with this assumption:

typedef   signed char       INT8;
typedef unsigned char      UINT8;
typedef   signed short      INT16;
typedef unsigned short     UINT16;
typedef   signed int        INT32;
typedef unsigned int       UINT32;
#if defined(_MSC_VER) || defined(__DECC)
typedef   signed __int64  INT64;
typedef unsigned __int64 UINT64;
typedef   signed long long  INT64;
typedef unsigned long long UINT64;

though I realize that isn't *entirely* portable.

I guess..

typedef unsigned char UQItype;
typedef         int SItype;
typedef unsigned USItype;
#if defined(_MSC_VER) || defined(__DECC)

typedef __int64 DItype;

typedef unsigned __int64 UDItype;

typedef    long long int DItype;

typedef unsigned long long int UDItype;


I understand, as I said, that long is often 64 bits, there
isn't necessarily a need to resort to "long long" or "__int64".
But they are also pretty portable.

You should maybe look at gcc's hwint.h.
It handles 64bit long and long long vs. __int64.

 - Jay

More information about the gmp-bugs mailing list