https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70181
Manuel López-Ibáñez <manu at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |manu at gcc dot gnu.org
--- Comment #2 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #1)
> I think it is intentional, because it otherwise leads to way too many false
> positives. We don't warn for (0 == 0), that is very common, e.g. if the
> constants come from macros. And for constants it is the same thing.
Clang does not warn if either operand comes from a macro. That seems a better
heuristic. It also does not warn for literals, even if explicit.