]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
(check_format_info): Don't warn about format type mismatch if the
authorRichard Kenner <kenner@gcc.gnu.org>
Tue, 26 Sep 1995 20:36:10 +0000 (16:36 -0400)
committerRichard Kenner <kenner@gcc.gnu.org>
Tue, 26 Sep 1995 20:36:10 +0000 (16:36 -0400)
argument is an ERROR_MARK.

From-SVN: r10401

gcc/c-common.c

index 3d5d3f29e13dc259685c85b2772253fba9ac6f18..41362faf2c49b54493c6853298f37f9eec13f10c 100644 (file)
@@ -1224,16 +1224,20 @@ check_format_info (info, params)
              cur_type = TREE_TYPE (cur_type);
              continue;
            }
-         sprintf (message,
-                  "format argument is not a %s (arg %d)",
-                  ((fci->pointer_count == 1) ? "pointer" : "pointer to a pointer"),
-                  arg_num);
-         warning (message);
+         if (TREE_CODE (cur_type) != ERROR_MARK)
+           {
+             sprintf (message,
+                      "format argument is not a %s (arg %d)",
+                      ((fci->pointer_count == 1) ? "pointer" : "pointer to a pointer"),
+                      arg_num);
+             warning (message);
+           }
          break;
        }
 
       /* Check the type of the "real" argument, if there's a type we want.  */
       if (i == fci->pointer_count && wanted_type != 0
+         && TREE_CODE (cur_type) != ERROR_MARK
          && wanted_type != TYPE_MAIN_VARIANT (cur_type)
          /* If we want `void *', allow any pointer type.
             (Anything else would already have got a warning.)  */