Re: float to int conversion

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

 



On Mon, 22 Apr 2013 11:44:58 +0000
"Warlich, Christof" <christof.warlich@xxxxxxxxxxx> wrote:

> But imho, anything, even "undefined (but fixed)", would be better than
> "varying depending on the level of optimization". 
"undefined" behavior can't be "fixed". if it is fixed, it is defined.
the only way one can get "fixed" behavior is to change the standard, so
that standard will clearly specify what to do in such cases. until than
compiler authors are free to change results of undefined operations.

it's really a bad practice to depend on undefined behavior. this will
tie the software to the given version of the given compiler and
architecture. even recompiling the software with the exact same
compiler version, but for ARM instead of x86, for example, can break
everything. so in practice one should assume that result of "undefined
behavior" can be *anything*, including creating new Black Hole or Sun
becomes Supernova.

Attachment: signature.asc
Description: PGP signature


[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