This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Traditional numbers


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]