OSDN Git Service

* c-decl.c (finish_struct): Use complete sentences for diagnostic
authorjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 7 Nov 2004 00:33:59 +0000 (00:33 +0000)
committerjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 7 Nov 2004 00:33:59 +0000 (00:33 +0000)
for structures or unions with no members or named members.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@90217 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/c-decl.c

index 5a004d5..d39640f 100644 (file)
@@ -1,5 +1,10 @@
 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
        taking address of bit-field by assertion.
 
index ba4249a..12f89aa 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.