From a89ca5c67eea6e16f22b4325be029484ab8ebcc2 Mon Sep 17 00:00:00 2001 From: Richard Kenner Date: Wed, 26 Apr 1995 17:23:10 -0400 Subject: (init_attributes): Don't require decl for A_PACKED. (decl_attributes, case A_PACKED): Set TYPE_PACKED for type. From-SVN: r9485 --- gcc/c-common.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'gcc/c-common.c') diff --git a/gcc/c-common.c b/gcc/c-common.c index 18d6265..474586e 100644 --- a/gcc/c-common.c +++ b/gcc/c-common.c @@ -246,7 +246,7 @@ add_attribute (id, string, min_len, max_len, decl_req) static void init_attributes () { - add_attribute (A_PACKED, "packed", 0, 0, 1); + add_attribute (A_PACKED, "packed", 0, 0, 0); add_attribute (A_NOCOMMON, "nocommon", 0, 0, 1); add_attribute (A_NORETURN, "noreturn", 0, 0, 1); add_attribute (A_NORETURN, "volatile", 0, 0, 1); @@ -325,7 +325,9 @@ decl_attributes (node, attributes, prefix_attributes) switch (id) { case A_PACKED: - if (TREE_CODE (decl) == FIELD_DECL) + if (decl == 0) + TYPE_PACKED (type) = 1; + else if (TREE_CODE (decl) == FIELD_DECL) DECL_PACKED (decl) = 1; /* We can't set DECL_PACKED for a VAR_DECL, because the bit is used for DECL_REGISTER. It wouldn't mean anything anyway. */ -- cgit v1.1