Neither GCC 4.6.0 (release) and 4.7 svn (r181390) warn about the impossible comparison in bool f(bool b) { return (b == 'a'); } The optimizer figures out it is always false and will optimize it to xorl %eax, %eax ret From the description in the manual I would have expected -Wtype-limits to detect this case.
Dup of bug 44077 *** This bug has been marked as a duplicate of bug 44077 ***