diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c index 378afae..9444f29 100644 --- a/gcc/c-family/c-common.c +++ b/gcc/c-family/c-common.c @@ -11642,6 +11642,10 @@ warn_about_parentheses (location_t loc, enum tree_code code, else if (code_right == MINUS_EXPR) warning_at (EXPR_LOC_OR_LOC (arg_right, loc), OPT_Wparentheses, "suggest parentheses around %<-%> in operand of %<&%>"); + else if (TREE_CODE_CLASS (code_left) == tcc_comparison + && TREE_CODE_CLASS (code_right) == tcc_comparison) + warning_at (loc, OPT_Wparentheses, + "suggest && instead of &"); /* Check cases like x&y==z */ else if (TREE_CODE_CLASS (code_left) == tcc_comparison) warning_at (EXPR_LOC_OR_LOC (arg_left, loc), OPT_Wparentheses,