--- p/predef.c.orig Sun Aug 6 00:58:59 2006 +++ p/predef.c Sun Aug 6 00:59:10 2006 @@ -2613,7 +2613,7 @@ case '<': { int nopad = r_num == p_EQ || r_num == p_LT; - const char *warning_str = NULL; + const char *warning_str = NULL, *warning_op = NULL; if (swapargs) { @@ -2627,11 +2627,12 @@ unsigned HOST_WIDE_INT l1 = get_string_length_plus_1 (val, nopad), l2 = get_string_length_plus_1 (val2, nopad); tree c1 = PASCAL_TYPE_STRING (TREE_TYPE (val )) ? PASCAL_STRING_CAPACITY (val ) : PASCAL_STRING_LENGTH (val ); tree c2 = PASCAL_TYPE_STRING (TREE_TYPE (val2)) ? PASCAL_STRING_CAPACITY (val2) : PASCAL_STRING_LENGTH (val2); + warning_op = invert_result ? "<>" : "="; if (l1 > 0 && l2 > 0 && l1 != l2) - warning_str = "string comparison is always %s due to different length of fixed-size strings"; + warning_str = "`%s' comparison of fixed-size strings is always %s due to different length"; else if ((l2 > 0 && TREE_CODE (c1) == INTEGER_CST && TREE_INT_CST_LOW (c1) < l2 - 1) || (l1 > 0 && TREE_CODE (c2) == INTEGER_CST && TREE_INT_CST_LOW (c2) < l1 - 1)) - warning_str = "string comparison is always %s because the capacity of one string is smaller than the length of the fixed-size string"; + warning_str = "`%s' string comparison is always %s because the capacity of one string is smaller than the length of the fixed-size string"; } if (!warning_str && IS_STRING_CST (val) && IS_STRING_CST (val2)) @@ -2689,7 +2690,10 @@ else if (IS_CONSTANT_EMPTY_STRING (val2)) { if (r_num == p_LT) /* s < '' is impossible */ - warning_str = "`>=' comparison against the empty string is always %s."; + { + warning_op = invert_result ? ">=" : "<"; + warning_str = "`%s' comparison against the empty string is always %s."; + } else comp_empty = val; } @@ -2707,7 +2711,7 @@ if (warning_str) { - warning (warning_str, invert_result ? "true" : "false"); + warning (warning_str, warning_op, invert_result ? "true" : "false"); if (TREE_SIDE_EFFECTS (val) || TREE_SIDE_EFFECTS (val2)) warning (" Operand with side-effects is not evaluated."); return invert_result ? boolean_true_node : boolean_false_node;