This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Traditional numbers
- To: gcc at gcc dot gnu dot org
- Subject: Re: Traditional numbers
- From: Neil Booth <neil at daikokuya dot demon dot co dot uk>
- Date: Mon, 30 Jul 2001 20:13:12 +0100
James Grosbach wrote:-
> Yes. According to my understanding of the standard, the compiler
> is in error.
But there was no standard; this is traditional C. If we're going to
support traditional C, we should do whatever the old compilers used to
do, assuming they were consistent amongst themselves, which is not
necessarily what C89 does.
Or we could just drop support for traditional C, and make a lot of
people happy, and a lot of others unhappy :-)
> The integer constant should be of the first type from the following
> list into which the value will fit: int, unsigned int, long int,
> unsigned long int. The value 0xffffffff will not fit in a signed
> 32-bit type, so the type of the constant is unsigned int, and the
> comparison should yield false.
That's not quite right. All CPP arithmetic is done in the target's
(u)intmax_t, which for a 32-bit arch would tend to be 64 bits.
For CPP, 0xffffffff is positive and of type long long on x86 Linux,
for example.
Neil.