This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
RE: signed is undefined and has been since 1992 (in GCC)
- From: "Dave Korn" <dave dot korn at artimi dot com>
- To: "'Olivier Galibert'" <galibert at pobox dot com>,"'Robert Dewar'" <dewar at adacore dot com>
- Cc: "'Gabriel Dos Reis'" <gdr at integrable-solutions dot net>,"'Andrew Pinski'" <pinskia at physics dot uc dot edu>,"'gcc mailing list'" <gcc at gcc dot gnu dot org>
- Date: Tue, 28 Jun 2005 15:39:38 +0100
- Subject: RE: signed is undefined and has been since 1992 (in GCC)
----Original Message----
>From: Olivier Galibert
>Sent: 28 June 2005 15:25
> In particular, a very large number of C and C++ programs are written
> with the assumptions:
This is a bad line of reasoning in general. There is a vast amount of bad
software in the world, some blatantly buggy, some subtly-incorrect. To
attempt to fix it all in the compiler rather than the source seems a bit
bass-ackwards to me!
> - sizeof(int) == 4, sizeof(long long) == 8
>
> - sizeof(long) == sizeof(void *) == sizeof(void (*)())
>
> Break them and see your compiler rejected by pretty much everybody.
And what about 64 bit architectures? Your assumptions are already widely
invalid and only going to get more so.
cheers,
DaveK
--
Can't think of a witty .sigline today....