[PATCH] Warn against (uchar < 0) and (ushort < 0)

This patch adds support to warn against tautological comparisons like (uchar < 0) and (ushort < 0). See kernel/git/torvalds/linux.git - Linux kernel source tree for an example.

Clang currently only warns against unsigned comparisons like (uint < 0). Clang ignores (uchar < 0) and (ushort < 0) because they are essentially signed comparisons, where uchar/ushort is sign-extended to signed int.

This patch changes one existing test case, where (bool < 0) is used.

warn_uchar_ushort.patch (3.57 KB)