bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GCC optimizes integer overflow: bug or feature?


From: Paul Eggert
Subject: Re: GCC optimizes integer overflow: bug or feature?
Date: Thu, 21 Dec 2006 13:52:37 -0800
User-agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.4 (gnu/linux)

"Joseph S. Myers" <address@hidden> writes:

> Conversion of out-of-range integers to signed types is 
> implementation-defined not undefined,

Thanks for the correction; I keep forgetting that.  However,
a conforming implementation is allowed to raise a signal for
those conversions, which could break the code in question,
i.e., it could cause the test to report the wrong result.
So the distinction between undefined and
implementation-defined behavior doesn't much matter here.
(Presumably the code could work around the problem by
trapping the signal, but that is another can of porting
worms.)

I daresay many conversions of out-of-range values to signed
integers are in a similar boat.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]