diff options
author | Richard Kenner <kenner@gcc.gnu.org> | 1995-09-26 16:36:10 -0400 |
---|---|---|
committer | Richard Kenner <kenner@gcc.gnu.org> | 1995-09-26 16:36:10 -0400 |
commit | 8741664047034e6bb35eb06645ceeb3a08eb6a3a (patch) | |
tree | 77d15f2e923c778fa16a4372e9a4be408693efe8 /gcc/c-common.c | |
parent | f05a769fb8c39bf579ea51cb11f7d7033877d997 (diff) | |
download | gcc-8741664047034e6bb35eb06645ceeb3a08eb6a3a.tar.gz |
(check_format_info): Don't warn about format type mismatch if the
argument is an ERROR_MARK.
From-SVN: r10401
Diffstat (limited to 'gcc/c-common.c')
-rw-r--r-- | gcc/c-common.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/gcc/c-common.c b/gcc/c-common.c index 3d5d3f29e13..41362faf2c4 100644 --- a/gcc/c-common.c +++ b/gcc/c-common.c @@ -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.) */ |