aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Stallman <rms@gnu.org>1992-07-25 08:06:54 +0000
committerRichard Stallman <rms@gnu.org>1992-07-25 08:06:54 +0000
commit9282f2f99b5ea1442fc568bd96eab0bd34e05c97 (patch)
tree7acc632524fb274d57dfdb39219915859cbaefaf
parent5fe86b8b83f384152d6701c5ce21ab7c22039521 (diff)
downloadgcc-9282f2f99b5ea1442fc568bd96eab0bd34e05c97.zip
gcc-9282f2f99b5ea1442fc568bd96eab0bd34e05c97.tar.gz
gcc-9282f2f99b5ea1442fc568bd96eab0bd34e05c97.tar.bz2
(shadow_tag_warned): New function.
From-SVN: r1684
-rw-r--r--gcc/c-decl.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index d6b64e3..096ce32 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -385,6 +385,7 @@ static struct binding_level *label_level_chain;
static tree grokparms (), grokdeclarator ();
tree pushdecl ();
tree builtin_function ();
+void shadow_tag_warned ();
static tree lookup_tag ();
static tree lookup_tag_reverse ();
@@ -2790,8 +2791,15 @@ void
shadow_tag (declspecs)
tree declspecs;
{
+ shadow_tag_warned (declspecs, 0);
+}
+
+void
+shadow_tag_warned (declspecs, warned)
+ tree declspecs;
+ int warned;
+{
int found_tag = 0;
- int warned = 0;
register tree link;
pending_invalid_xref = 0;
@@ -2812,7 +2820,7 @@ shadow_tag (declspecs)
if (name == 0)
{
- if (code != ENUMERAL_TYPE) /* Empty unnamed enum OK */
+ if (!warned && code != ENUMERAL_TYPE) /* Empty unnamed enum OK */
{
pedwarn ("unnamed struct/union that defines no instances");
warned = 1;