This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Should GCC publish a general rule/warning due to it's default presumption of undefined signed integer overflow semantics?
- From: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- To: Joe Buck <Joe dot Buck at synopsys dot COM>
- Cc: Paul Schlie <schlie at comcast dot net>, gcc at gcc dot gnu dot org
- Date: 01 Jul 2005 00:25:58 +0200
- Subject: Re: Should GCC publish a general rule/warning due to it's default presumption of undefined signed integer overflow semantics?
- References: <BEE9BCEE.AAC7%schlie@comcast.net><20050630220250.GA10768@synopsys.com>
Joe Buck <Joe.Buck@synopsys.COM> writes:
[...]
| Given your biases, you might be happier with Java as a language (than C or
| C++). The Java language designers decided to strictly define many cases
| that are not defined in C (example: the order side effects is always
| strictly left to right, floating point is always IEEE, etc., integer
| overflow wraps around). There is a performance penalty for this, but
| given the "write once, run everywhere" goal it was felt that it's worth
| paying this price.
Well, in the case of C++ I can say that the designer and original
implementor of C++ is quite amazed as to how people interpret
"undefined behaviour" in this thread. I don't think he would suggest
that people go to use Java instead.
-- Gaby