Attached is a v2 that incorporates comments from Richard.  A unified
function is used for checking trivial signed/unsigned comparisons.

- xi

On Feb 29, 2012, at 11:36 AM, Xi Wang wrote:

> Clang doesn't issue warnings against tautological comparisons like
> (uchar < 0) and (uchar == -1).  Such tautological comparisons are
> often logic bugs that break the error handling.  Below are some
> recent examples.
> 
> http://git.kernel.org/linus/3a7f8fb1
> http://git.kernel.org/linus/589665f5
> http://git.kernel.org/linus/4690c33d
> 
> This patch enhances Clang to catch such tautological comparisons,
> where bool/uchar/ushort is sign-extended to signed int.  Clang
> currently only warns against unsigned tautological comparisons.

Attachment: scmp2.patch
Description: Binary data


_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to