diff options
author | Richard Kenner <kenner@gcc.gnu.org> | 1995-04-10 08:20:09 -0400 |
---|---|---|
committer | Richard Kenner <kenner@gcc.gnu.org> | 1995-04-10 08:20:09 -0400 |
commit | bbb1ae016cedce6f118a402e2aa92d701be5e366 (patch) | |
tree | 822bec375fea5df287456e0dcfdb6e8ebf873c57 /gcc | |
parent | f507a0704432f434b19063ced39f4e5cba986a5d (diff) | |
download | gcc-bbb1ae016cedce6f118a402e2aa92d701be5e366.zip gcc-bbb1ae016cedce6f118a402e2aa92d701be5e366.tar.gz gcc-bbb1ae016cedce6f118a402e2aa92d701be5e366.tar.bz2 |
(enum attrs): New attribute, A_NOCOMMON.
(init_attribute): Initialize it.
(decl_attributes): Implement it.
From-SVN: r9347
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/c-common.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/gcc/c-common.c b/gcc/c-common.c index 0e5d492..1c1a5da 100644 --- a/gcc/c-common.c +++ b/gcc/c-common.c @@ -28,8 +28,9 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ extern struct obstack permanent_obstack; -enum attrs {A_PACKED, A_NORETURN, A_CONST, A_T_UNION, A_CONSTRUCTOR, - A_DESTRUCTOR, A_MODE, A_SECTION, A_ALIGNED, A_FORMAT}; +enum attrs {A_PACKED, A_NOCOMMON, A_NORETURN, A_CONST, A_T_UNION, + A_CONSTRUCTOR, A_DESTRUCTOR, A_MODE, A_SECTION, A_ALIGNED, + A_FORMAT}; static void declare_hidden_char_array PROTO((char *, char *)); static void add_attribute PROTO((enum attrs, char *, @@ -246,6 +247,7 @@ static void init_attributes () { add_attribute (A_PACKED, "packed", 0, 0, 1); + add_attribute (A_NOCOMMON, "nocommon", 0, 0, 1); add_attribute (A_NORETURN, "noreturn", 0, 0, 1); add_attribute (A_NORETURN, "volatile", 0, 0, 1); add_attribute (A_CONST, "const", 0, 0, 1); @@ -329,6 +331,13 @@ decl_attributes (node, attributes, prefix_attributes) warning ("`%s' attribute ignored", IDENTIFIER_POINTER (name)); break; + case A_NOCOMMON: + if (TREE_CODE (decl) == VAR_DECL) + DECL_COMMON (decl) = 0; + else + warning ("`%s' attribute ignored", IDENTIFIER_POINTER (name)); + break; + case A_NORETURN: if (TREE_CODE (decl) == FUNCTION_DECL) TREE_THIS_VOLATILE (decl) = 1; |