]> gcc.gnu.org Git - gcc.git/commitdiff
c-decl.c (finish_struct): Use complete sentences for diagnostic for structures or...
authorJoseph Myers <joseph@codesourcery.com>
Sun, 7 Nov 2004 00:33:59 +0000 (00:33 +0000)
committerJoseph Myers <jsm28@gcc.gnu.org>
Sun, 7 Nov 2004 00:33:59 +0000 (00:33 +0000)
* c-decl.c (finish_struct): Use complete sentences for diagnostic
for structures or unions with no members or named members.

From-SVN: r90217

gcc/ChangeLog
gcc/c-decl.c

index 5a004d507d935a7c5b2a4986df176bab0d9abe4c..d39640fc275be0fa20c63fa6232247ea62337813 100644 (file)
@@ -1,3 +1,8 @@
+2004-11-07  Joseph S. Myers  <joseph@codesourcery.com>
+
+       * c-decl.c (finish_struct): Use complete sentences for diagnostic
+       for structures or unions with no members or named members.
+
 2004-11-07  Joseph S. Myers  <joseph@codesourcery.com>
 
        * c-typeck.c (build_unary_op): Replace unreachable diagnostic for
index ba4249ac37c2befd656837d1f3a8c537a398fdd3..12f89aaacc1933d7e6b8f7e855086c2942bbc9fd 100644 (file)
@@ -5157,9 +5157,22 @@ finish_struct (tree t, tree fieldlist, tree attributes)
          break;
 
       if (x == 0)
-       pedwarn ("%s has no %s",
-                TREE_CODE (t) == UNION_TYPE ? _("union") : _("struct"),
-                fieldlist ? _("named members") : _("members"));
+       {
+         if (TREE_CODE (t) == UNION_TYPE)
+           {
+             if (fieldlist)
+               pedwarn ("union has no named members");
+             else
+               pedwarn ("union has no members");
+           }
+         else
+           {
+             if (fieldlist)
+               pedwarn ("struct has no named members");
+             else
+               pedwarn ("struct has no members");
+           }
+       }
     }
 
   /* Install struct as DECL_CONTEXT of each field decl.
This page took 0.091138 seconds and 5 git commands to generate.