preprocessor/5806: The preprocessor evaluates expression s in 64-bit, violating IS C++ 16.1.4
'Zack Weinberg'
zack@codesourcery.com
Thu Mar 14 15:16:00 GMT 2002
The following reply was made to PR preprocessor/5806; it has been noted by GNATS.
From: 'Zack Weinberg' <zack@codesourcery.com>
To: "Dana, Eric" <Eric_Dana@bmc.com>
Cc: 'Neil Booth' <neil@daikokuya.demon.co.uk>,
"'gcc-gnats@gcc.gnu.org'" <gcc-gnats@gcc.gnu.org>,
"Schoeller, Dick" <Dick_Schoeller@bmc.com>
Subject: Re: preprocessor/5806: The preprocessor evaluates expression s in 64-bit, violating IS C++ 16.1.4
Date: Thu, 14 Mar 2002 15:14:39 -0800
On Thu, Mar 14, 2002 at 02:58:41PM -0600, Dana, Eric wrote:
> Zack,
>
> Is there anything that can be done for 3.1? In it's present state,
> Dynix cannot work properly as many of its include files test for
> 32/64 bit using the preprocessor. For example:
>
> #if ((~0UL) == 0xffffffffUL)
> typedef unsigned int size_t; /* ILP32 size_t */
> #else /* ((~0UL) == 0xffffffffUL) */
> typedef unsigned long size_t; /* LP64 size_t */
> #endif /* ((~0UL) == 0xffffffffUL) */
In the short term, a fixincludes hack is probably the right move. GCC
almost certainly provides a predefined macro that you can use to
detect the mode you're in -- tell me the output of config.guess and I
can figure out what it should be. Then you have fixincludes look for
that #if and change it to an appropriate test of the macro.
zw
More information about the Gcc-prs
mailing list