Re: Efficient detection of signed overflow?

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

 



* Mark Dickinson:

> In practice, yes, I think so.  In theory, no: the result of the conversion is
> implementation defined for numbers outside the range of the signed type.
> (C99 6.3.1.3).  But I'd be surprised if any implementation on a two's
> complement machine does anything other than just preserve the bit
> pattern, as you'd expect.

It really depends on your compiler writer's meaning of
"implementation-defined".  It's not too far-fetched that some think
that the comparison against zero should be replaced with 0 because it
can never be true.

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux