A little story
Don Clugston
dac at nospam.com
Tue Jun 26 03:03:07 PDT 2012
On 25/06/12 14:24, bearophile wrote:
> Dmitry Olshansky:
>
>>> Except for the fact, that someone has to implement it.
>
> I am not seeing one of the posts of this thread. So I'll answer here.
>
> The good thing regarding the run-time overflow integral tests is that
> they are already implemented and available as efficient compiler
> intrinsics in both GCC and LLVM back-ends. It's just a matter of using
> them (and introducing the compiler switch and some kind of pragma syntax).
>
> Bye,
> bearophile
Bearophile, haven't you ever read that paper on integer overflow, which
you keep posting to the newsgroup???
It clearly demonstrates that it is NOT POSSIBLE to implement integer
overflow checking in a C-family language. Valid, correct, code which
depends on integer overflow is very, very common (when overflow occurs,
it's more likely to be correct, than incorrect).
I don't think you could do it without introducing a no-overflow integer
type. The compiler just doesn't have enough information.
More information about the Digitalmars-d-learn
mailing list