M
Malcolm McLean
בת×ריך ×™×•× ×¨×שון, 12 ב×וגוסט 2012 01:30:46 UTC+1, מ×ת Keith Thompson:
Of course the implementation is free to choose the worst option, like
reformatting the hard drive. But normally it's choice between terminating,
with an erro message, continuing with a corrupt value, or continuing with
a NaN or infinity. Not all platforms support option 3, which is the probable
best choice.
It mean the implementation decides what the result of the operation will be..That's absurd. Undefined behavior means that whatever the *worst*
thing is, it can happen, whether that's crashing the program, or
continuing to execute quietly with bad data, or reformatting your
hard drive.
Of course the implementation is free to choose the worst option, like
reformatting the hard drive. But normally it's choice between terminating,
with an erro message, continuing with a corrupt value, or continuing with
a NaN or infinity. Not all platforms support option 3, which is the probable
best choice.