aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/parse.c
diff options
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2020-05-13 23:29:59 +0200
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2020-05-17 23:23:56 +0200
commitb508d84449b10b696c20be2ca58a89dfccb620d6 (patch)
tree065d1ddc7c555a87286b75c41956b93b2fdabfe3 /parse.c
parentd3a25d90664d833e9657689d920ee05bdba30f7f (diff)
downloadsparse-dev-b508d84449b10b696c20be2ca58a89dfccb620d6.tar.gz
attribute: allow some attribute to be present multiple times
A warning is issued when a qualifier or another modifier is present more than once in a declaration. This is fine but in the kernel some attributes, for example 'unused' & 'gnu_inline', are sometimes present multiple times in the same declaration (mainly they are added in the define used for 'inline'). This then creates a lot of useless noise. So, use a (now empty) white list to not warn when these attributes are present multiple times in the same declaration. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'parse.c')
-rw-r--r--parse.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/parse.c b/parse.c
index 974ff7a1..c1573b39 100644
--- a/parse.c
+++ b/parse.c
@@ -1129,7 +1129,7 @@ static struct token *attribute_aligned(struct token *token, struct symbol *attr,
static void apply_mod(struct position *pos, unsigned long *mods, unsigned long mod)
{
- if (*mods & mod)
+ if (*mods & mod & ~MOD_DUP_OK)
warning(*pos, "duplicate %s", modifier_string(mod));
*mods |= mod;
}