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)
Joe Buck <Joe.Buck@synopsys.COM> writes:
| On Tue, Jun 28, 2005 at 07:17:52PM +0200, Olivier Galibert wrote:
| > On Tue, Jun 28, 2005 at 04:03:49PM +0100, Andrew Haley wrote:
| > > This is childish and insulting.
| >
| > Calling a large part of the programs out there, including a non
| > negligible subpart of what I personally write either "blatantly buggy"
| > or "subtly-incorrect" is somewhat childish and insulting.
|
| I agree, partly, with Olivier. However, let's not insult each other;
| we need to recognize that GCC developers have to worry about embedded
| systems, where some of the assumptions Olivier makes do not hold.
|
| I make some of the same tradeoffs in my code as Olivier does, because
| the assumptions are true of all of the target platforms we care about.
| (In particular, either ILP32 or LP64, with IEEE FP arithmetic; for
| everything else we need rigorous type safety, unions if pointers share
| storage with longs, etc).
Once upon a time, a bunch of good, expert, knowledgeable guys got
together to design an optimizing compiler for C. They had one of the
best (if not The Best) optimizing C compilers at the time for
programs written within the well-defined part of C -- taking advantage
of undefined behaviour to propogate assumptions forward and backward.
It could blow up just about any competing compiler at the time.
...
But the compiler miscompiled the Unix kernel -- which, apart from has
history intermixed with the C language design, was relying on
"undocumented" aspect of "undefined behaviour". Nobdoy was willing to
buy the compiler. The company ran out of business.
-- Gaby