case NE_EXPR:
if (warn_float_equal && (code0 == REAL_TYPE || code1 == REAL_TYPE))
warning (0, "comparing floating point with == or != is unsafe");
+ if ((TREE_CODE (orig_op0) == STRING_CST && !integer_zerop (op1))
+ || (TREE_CODE (orig_op1) == STRING_CST && !integer_zerop (op0)))
+ warning (OPT_Wstring_literal_comparison,
+ "comparison with string literal");
build_type = boolean_type_node;
if ((code0 == INTEGER_TYPE || code0 == REAL_TYPE
case GE_EXPR:
case LT_EXPR:
case GT_EXPR:
+ if (TREE_CODE (orig_op0) == STRING_CST
+ || TREE_CODE (orig_op1) == STRING_CST)
+ warning (OPT_Wstring_literal_comparison,
+ "comparison with string literal");
+
build_type = boolean_type_node;
if ((code0 == INTEGER_TYPE || code0 == REAL_TYPE)
&& (code1 == INTEGER_TYPE || code1 == REAL_TYPE))
}
else
{
- error ("parenthesis around %qE cannot be used to form a"
+ error ("parentheses around %qE cannot be used to form a"
" pointer-to-member-function",
xarg);
PTRMEM_OK_P (xarg) = 1;