[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] [Bug target/35634] New: [avr] result of char promotio
Re: [avr-gcc-list] [Bug target/35634] New: [avr] result of char promotion comes out of CHAR_MIN/MAX
Thu, 20 Mar 2008 09:41:52 +0100
Thunderbird 22.214.171.124 (Windows/20080213)
Dave N6NZ schrieb:
Dmitry K. wrote:
Now I can not understand, why the Standart permits
'undefined behavior' with ordinary overflow,
Well, checking for integer overflow can cause a lot of code to be
generated on some architectures. That becomes both a space and
performance issue. In general, the C standard favors fast and small
over tightly defined results.
You might like Ada :)
Due to the poor code that gcc generates for detecting overflow (on all
platforms), overflow detection is swithced off by default in gcc-Ada.
You really have to insist and know about the -gnato option to get a
standard conforming Ada compiler.
For not getting completely off topic on the avr-gcc mailing list let me
point out that integer overflow is signaled by an exception in Ada and
exceptions are not (yet) supported in AVR-Ada.