(shadow_tag_warned): New function.
authorRichard Stallman <rms@gnu.org>
Sat, 25 Jul 1992 08:06:54 +0000 (08:06 +0000)
committerRichard Stallman <rms@gnu.org>
Sat, 25 Jul 1992 08:06:54 +0000 (08:06 +0000)
From-SVN: r1684

gcc/c-decl.c

index d6b64e3891e9efedbf13f0da5e30c79cbc38d347..096ce321d1e3a723732801ff88f7ecfc76225adb 100644 (file)
@@ -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 ();
@@ -2789,9 +2790,16 @@ builtin_function (name, type, function_code, library_name)
 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;