|
From: | Rolf Ebert |
Subject: | Re: [avr-gcc-list] [Bug target/35634] New: [avr] result of char promotion comes out of CHAR_MIN/MAX |
Date: | Thu, 20 Mar 2008 09:41:52 +0100 |
User-agent: | Thunderbird 2.0.0.12 (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 :) Just kidding.
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.
Rolf
[Prev in Thread] | Current Thread | [Next in Thread] |