Patch to check for Integer overflow in presence of casts.

jahanian fjahanian at apple.com
Tue Oct 14 11:38:47 PDT 2014


Currently we do not warn Integer overflow in presence of casts; as in:
unsigned long long l = 65536 * 65536;

This small patch fixes it:



Also, is there a reason we do not warn on overflow for unsigned; as in:
unsigned long long l2 = 65536 * (unsigned)65536;
Even though resulting constant is the unexpected 0.

- Please review and comment.

- Thanks, Fariborz

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20141014/13b19563/attachment.html>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch.txt
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20141014/13b19563/attachment.txt>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20141014/13b19563/attachment-0001.html>


More information about the cfe-commits mailing list