summaryrefslogtreecommitdiff
path: root/gcc/c-common.c
diff options
context:
space:
mode:
authorkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>1995-04-10 12:20:09 +0000
committerkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>1995-04-10 12:20:09 +0000
commit1f57d1e5376f3915b10499ad2cd05a75516ad075 (patch)
tree822bec375fea5df287456e0dcfdb6e8ebf873c57 /gcc/c-common.c
parentfbf9611777cca96d011efe82b671c94098c69c95 (diff)
downloadgcc-1f57d1e5376f3915b10499ad2cd05a75516ad075.tar.gz
(enum attrs): New attribute, A_NOCOMMON.
(init_attribute): Initialize it. (decl_attributes): Implement it. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@9347 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-common.c')
-rw-r--r--gcc/c-common.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/gcc/c-common.c b/gcc/c-common.c
index 0e5d4926e22..1c1a5da57e3 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;