[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
Wed, 19 Mar 2008 12:17:59 +0000
Thunderbird 220.127.116.11 (X11/20071210)
Dmitry K. wrote:
void foo (int i)
static int n;
if (i < CHAR_MIN || i > CHAR_MAX)
if (++n > 1000)
int main ()
for (c = 0; ; c++) foo (c);
Is this strictly wrong, from the C definition point of view?
I know that signed overflow is "undefined". How does this test case
interacts with -fwrapv and -fno-strict-overflow?
For those unaware of signed overflow issues, there is a nice sum up here:
I know that turning "undefined" into an "out of range" result is ugly,
but so is signed overflow....
Software Development Department - Grupo PIE, S.A.
Phone: +351 252 290600, Fax: +351 252 290601
"...so she told me it was either her or the ham radio, over."