Russ Allbery wrote:
> Shachar Shemesh <[email protected]> writes:
>> Do you really want to get a "Warning: signed integer overflow yields
>> undefined behavior" on this function?
> 
> I would certainly like to be able to enable such a thing.  I write a lot
> of code where I'd love the compiler to double-check that I've established
> bounds checks on a and b before doing the addition that guarantee that it
> won't overflow.

Not quite to that point, but you might be interested in the UBS:

http://clang.llvm.org/docs/UsersManual.html#controlling-code-generation

More specifically, two options: -fsanitize=undefined and -fsanitize=integer

And some nice examples:
http://blog.regehr.org/archives/1054
http://blog.regehr.org/archives/963

Cheers,
-- 
Raphael Geissert - Debian Developer
www.debian.org - get.debian.net


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]
Archive: https://lists.debian.org/[email protected]

Reply via email to