OSDN Git Service

(build_binary_op): Warn for ordered compare of ptr with 0
authorrms <rms@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 8 Nov 1993 21:51:20 +0000 (21:51 +0000)
committerrms <rms@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 8 Nov 1993 21:51:20 +0000 (21:51 +0000)
only if pedantic in both cases.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@6039 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/c-typeck.c

index 410e10d..6cd52c5 100644 (file)
@@ -2211,7 +2211,7 @@ build_binary_op (code, orig_op0, orig_op1, convert_p)
        {
          result_type = integer_type_node;
          op1 = null_pointer_node;
-         if (! flag_traditional)
+         if (pedantic)
            pedwarn ("ordered comparison of pointer with integer zero");
        }
       else if (code1 == POINTER_TYPE && TREE_CODE (op0) == INTEGER_CST