aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2004-11-07 00:33:59 +0000
committerJoseph Myers <jsm28@gcc.gnu.org>2004-11-07 00:33:59 +0000
commitcc0b9d525cf373d17dc117e0a29009da8a4af05d (patch)
treed3548981f587b7fc793e4fc293e916558476addf
parentabb54d14c0aed154b2d57c56ee9e6b93888f0b7e (diff)
downloadgcc-cc0b9d525cf373d17dc117e0a29009da8a4af05d.zip
gcc-cc0b9d525cf373d17dc117e0a29009da8a4af05d.tar.gz
gcc-cc0b9d525cf373d17dc117e0a29009da8a4af05d.tar.bz2
c-decl.c (finish_struct): Use complete sentences for diagnostic for structures or unions with no members...
* c-decl.c (finish_struct): Use complete sentences for diagnostic for structures or unions with no members or named members. From-SVN: r90217
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/c-decl.c19
2 files changed, 21 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 5a004d5..d39640f 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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.
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index ba4249a..12f89aa 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -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.