Commit cc0b9d52 by Joseph Myers Committed by Joseph Myers

c-decl.c (finish_struct): Use complete sentences for diagnostic for structures…

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
parent abb54d14
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.
......
......@@ -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.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment