Add common attribute

This commit is contained in:
christos 2021-04-20 21:48:39 +00:00
parent c510facea2
commit 38e22eb187
2 changed files with 7 additions and 4 deletions

View File

@ -1,5 +1,5 @@
%{
/* $NetBSD: cgram.y,v 1.219 2021/04/18 21:53:37 rillig Exp $ */
/* $NetBSD: cgram.y,v 1.220 2021/04/20 21:48:39 christos Exp $ */
/*
* Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved.
@ -35,7 +35,7 @@
#include <sys/cdefs.h>
#if defined(__RCSID) && !defined(lint)
__RCSID("$NetBSD: cgram.y,v 1.219 2021/04/18 21:53:37 rillig Exp $");
__RCSID("$NetBSD: cgram.y,v 1.220 2021/04/20 21:48:39 christos Exp $");
#endif
#include <limits.h>
@ -215,6 +215,7 @@ anonymize(sym_t *s)
%token <y_type> T_AT_BOUNDED
%token <y_type> T_AT_BUFFER
%token <y_type> T_AT_COLD
%token <y_type> T_AT_COMMON
%token <y_type> T_AT_CONSTRUCTOR
%token <y_type> T_AT_DEPRECATED
%token <y_type> T_AT_DESTRUCTOR
@ -578,6 +579,7 @@ type_attribute_spec:
| T_AT_NORETURN
| T_AT_NOTHROW
| T_AT_COLD
| T_AT_COMMON
| T_AT_RETURNS_TWICE
| T_AT_PACKED {
addpacked();

View File

@ -1,4 +1,4 @@
/* $NetBSD: lex.c,v 1.28 2021/04/18 08:00:13 rillig Exp $ */
/* $NetBSD: lex.c,v 1.29 2021/04/20 21:48:39 christos Exp $ */
/*
* Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved.
@ -38,7 +38,7 @@
#include <sys/cdefs.h>
#if defined(__RCSID) && !defined(lint)
__RCSID("$NetBSD: lex.c,v 1.28 2021/04/18 08:00:13 rillig Exp $");
__RCSID("$NetBSD: lex.c,v 1.29 2021/04/20 21:48:39 christos Exp $");
#endif
#include <ctype.h>
@ -157,6 +157,7 @@ static struct kwtab {
kwdef_token( "case", T_CASE, 0,0,0,0,1),
kwdef_type( "char", CHAR, 0,0,0,0,1),
kwdef_token( "cold", T_AT_COLD, 0,0,1,1,5),
kwdef_token( "common", T_AT_COMMON, 0,0,1,1,5),
kwdef_tqual( "const", CONST, 1,0,0,0,7),
kwdef_token( "constructor", T_AT_CONSTRUCTOR, 0,0,1,1,5),
kwdef_token( "continue", T_CONTINUE, 0,0,0,0,1),