diff options
author | Richard Kenner <kenner@gcc.gnu.org> | 1994-08-12 07:52:04 -0400 |
---|---|---|
committer | Richard Kenner <kenner@gcc.gnu.org> | 1994-08-12 07:52:04 -0400 |
commit | 8e5e53da6cd3007257f59f01a5101f6d9d914217 (patch) | |
tree | 72d091bd7f24f7a19d17dd1ae3842abfec4b7fde /gcc | |
parent | 7b9032dda340f9f36add9584b3e232ea49e6325d (diff) | |
download | gcc-8e5e53da6cd3007257f59f01a5101f6d9d914217.zip gcc-8e5e53da6cd3007257f59f01a5101f6d9d914217.tar.gz gcc-8e5e53da6cd3007257f59f01a5101f6d9d914217.tar.bz2 |
(duplicate_decls): Suppress -Wredundant-decls warning if we have
already given an error.
From-SVN: r7900
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/c-decl.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c index 9f143d8..915f3aa 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -1303,6 +1303,7 @@ duplicate_decls (newdecl, olddecl) && DECL_INITIAL (newdecl) != 0); tree oldtype = TREE_TYPE (olddecl); tree newtype = TREE_TYPE (newdecl); + char *errmsg = 0; if (TREE_CODE (newtype) == ERROR_MARK || TREE_CODE (oldtype) == ERROR_MARK) @@ -1528,7 +1529,7 @@ duplicate_decls (newdecl, olddecl) } else { - char *errmsg = redeclaration_error_message (newdecl, olddecl); + errmsg = redeclaration_error_message (newdecl, olddecl); if (errmsg) { error_with_decl (newdecl, errmsg); @@ -1625,7 +1626,7 @@ duplicate_decls (newdecl, olddecl) } /* Optionally warn about more than one declaration for the same name. */ - if (warn_redundant_decls && DECL_SOURCE_LINE (olddecl) != 0 + if (errmsg = 0 && warn_redundant_decls && DECL_SOURCE_LINE (olddecl) != 0 /* Dont warn about a function declaration followed by a definition. */ && !(TREE_CODE (newdecl) == FUNCTION_DECL && DECL_INITIAL (newdecl) != 0 |