aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Stallman <rms@gnu.org>1992-03-08 22:08:20 +0000
committerRichard Stallman <rms@gnu.org>1992-03-08 22:08:20 +0000
commitc138f3280db10430f1b9b187968e72bb5f1e026a (patch)
tree474b7fecf62e02c04e0893b9fb85bb3d8f21a516 /gcc
parent5c23c401723bd1c663709d2ae3493bbeee02f9d1 (diff)
downloadgcc-c138f3280db10430f1b9b187968e72bb5f1e026a.zip
gcc-c138f3280db10430f1b9b187968e72bb5f1e026a.tar.gz
gcc-c138f3280db10430f1b9b187968e72bb5f1e026a.tar.bz2
*** empty log message ***
From-SVN: r423
Diffstat (limited to 'gcc')
-rw-r--r--gcc/c-decl.c40
1 files changed, 30 insertions, 10 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index 09038c1..70b24ad 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -1073,13 +1073,13 @@ pushtag (name, type)
if (TYPE_NAME (type) == 0)
TYPE_NAME (type) = name;
-
- if (b == global_binding_level)
- b->tags = perm_tree_cons (name, type, b->tags);
- else
- b->tags = saveable_tree_cons (name, type, b->tags);
}
+ if (b == global_binding_level)
+ b->tags = perm_tree_cons (name, type, b->tags);
+ else
+ b->tags = saveable_tree_cons (name, type, b->tags);
+
/* Create a fake NULL-named TYPE_DECL node whose TREE_TYPE will be the
tagged type we just added to the current binding level. This fake
NULL-named TYPE_DECL node helps dwarfout.c to know when it needs
@@ -4229,11 +4229,18 @@ parmlist_tags_warning ()
for (elt = current_binding_level->tags; elt; elt = TREE_CHAIN (elt))
{
enum tree_code code = TREE_CODE (TREE_VALUE (elt));
- warning ("`%s %s' declared inside parameter list",
- (code == RECORD_TYPE ? "struct"
- : code == UNION_TYPE ? "union"
- : "enum"),
- IDENTIFIER_POINTER (TREE_PURPOSE (elt)));
+ if (TREE_PURPOSE (elt) != 0)
+ warning ("`%s %s' declared inside parameter list",
+ (code == RECORD_TYPE ? "struct"
+ : code == UNION_TYPE ? "union"
+ : "enum"),
+ IDENTIFIER_POINTER (TREE_PURPOSE (elt)));
+ else
+ warning ("anonymous %s declared inside parameter list",
+ (code == RECORD_TYPE ? "struct"
+ : code == UNION_TYPE ? "union"
+ : "enum"));
+
if (! already)
{
warning ("its scope is only this definition or declaration,");
@@ -5310,6 +5317,19 @@ store_parm_decls ()
else
actual = type;
+ /* We are going to assign a new value for the TYPE_ACTUAL_ARG_TYPES
+ of the type of this function, but we need to avoid having this
+ affect the types of other similarly-typed functions, so we must
+ first force the generation of an identical (but separate) type
+ node for the relevant function type. The new node we create
+ will be a variant of the main variant of the original function
+ type. */
+
+ TREE_TYPE (fndecl)
+ = build_type_copy (TYPE_MAIN_VARIANT (TREE_TYPE (fndecl)),
+ TYPE_READONLY (TREE_TYPE (fndecl)),
+ TYPE_VOLATILE (TREE_TYPE (fndecl)));
+
TYPE_ACTUAL_ARG_TYPES (TREE_TYPE (fndecl)) = actual;
}