https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67030

--- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Could you please try whether this patch helps?

diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c
index 6a79b95..9fe9c5e 100644
--- a/gcc/c-family/c-common.c
+++ b/gcc/c-family/c-common.c
@@ -1890,6 +1890,10 @@ warn_tautological_cmp (location_t loc, enum tree_code
code, tree lhs, tree rhs)
   if (TREE_CODE_CLASS (code) != tcc_comparison)
     return;

+  if (from_macro_expansion_at (EXPR_LOCATION (lhs))
+      || from_macro_expansion_at (EXPR_LOCATION (rhs)))
+    return;
+
   /* We do not warn for constants because they are typical of macro
      expansions that test for features, sizeof, and similar.  */
   if (CONSTANT_CLASS_P (lhs) || CONSTANT_CLASS_P (rhs))

Reply via email to