Commit a7f64d52 by Richard Stallman

(finish_decl): Avoid cascading messages for tentative

definitions with incomplete types.

From-SVN: r1821
parent 8c31e6b6
...@@ -3143,19 +3143,19 @@ finish_decl (decl, init, asmspec_tree) ...@@ -3143,19 +3143,19 @@ finish_decl (decl, init, asmspec_tree)
if (TREE_CODE (decl) == VAR_DECL) if (TREE_CODE (decl) == VAR_DECL)
{ {
if (TREE_STATIC (decl) && DECL_SIZE (decl) == 0) if (DECL_SIZE (decl) == 0
{ && (TREE_STATIC (decl)
/* A static variable with an incomplete type: ?
that is an error if it is initialized or `static'. /* A static variable with an incomplete type
is an error if it is initialized or `static'.
Otherwise, let it through, but if it is not `extern' Otherwise, let it through, but if it is not `extern'
then it may cause an error message later. */ then it may cause an error message later. */
if (! (TREE_PUBLIC (decl) && DECL_INITIAL (decl) == 0)) !TREE_PUBLIC (decl) || DECL_INITIAL (decl)
error_with_decl (decl, "storage size of `%s' isn't known"); :
} /* An automatic variable with an incomplete type
else if (!DECL_EXTERNAL (decl) && DECL_SIZE (decl) == 0) is an error. */
!TREE_EXTERNAL (decl)))
{ {
/* An automatic variable with an incomplete type:
that is an error. */
error_with_decl (decl, "storage size of `%s' isn't known"); error_with_decl (decl, "storage size of `%s' isn't known");
TREE_TYPE (decl) = error_mark_node; TREE_TYPE (decl) = error_mark_node;
} }
......
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