aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2022-06-27 02:29:40 +0200
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2022-06-27 14:15:55 +0200
commit346ad756651e6c7c72f3012a4e1d57a49c327bc4 (patch)
treef95eb46f574fe9efca01a577bdd88b5c378c3930
parenta20ea60c1a18256f9e3b84d3781778067808aa50 (diff)
downloadsparse-346ad756651e6c7c72f3012a4e1d57a49c327bc4.tar.gz
bitwise: do not remove the signedness of bitwise types
When bitwise types were added [1] the signedness modifiers were removed from them. More exactly, it was MOD_SPECIFIER which was removed. I suppose this was done because then MOD_SPECIFIER contained the signedness bits but also MOD_CHAR, MOD_LONG, ... and those had to be removed. But currently MOD_SPECIFIER contains only MOD_SIGNEDNESS and the signedness info can be useful for bitwise types too. So, do not removed anymore MOD_SPECIFIER from the bitwise types' modifiers. [1] commit 032f492af0ac ("[PATCH] __attribute__((bitwise))") Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
-rw-r--r--parse.c1
-rw-r--r--show-parse.c2
-rw-r--r--validation/linear/bitwise-cmpu.c1
3 files changed, 1 insertions, 3 deletions
diff --git a/parse.c b/parse.c
index 3d6fef7c..14fe9e15 100644
--- a/parse.c
+++ b/parse.c
@@ -1586,7 +1586,6 @@ static struct token *declaration_specifiers(struct token *token, struct decl_sta
}
type = alloc_symbol(token->pos, SYM_BASETYPE);
*type = *ctx->ctype.base_type;
- type->ctype.modifiers &= ~MOD_SPECIFIER;
type->ctype.base_type = ctx->ctype.base_type;
type->type = SYM_RESTRICT;
ctx->ctype.base_type = type;
diff --git a/show-parse.c b/show-parse.c
index e2fc18bb..2ab2479b 100644
--- a/show-parse.c
+++ b/show-parse.c
@@ -318,7 +318,7 @@ deeper:
if (as)
prepend(name, "%s ", show_as(as));
- if (sym && (sym->type == SYM_BASETYPE || sym->type == SYM_ENUM))
+ if (sym && (sym->type == SYM_BASETYPE || sym->type == SYM_ENUM || sym->type == SYM_RESTRICT))
mod &= ~MOD_SPECIFIER;
s = modifier_string(mod);
len = strlen(s);
diff --git a/validation/linear/bitwise-cmpu.c b/validation/linear/bitwise-cmpu.c
index 8932436a..e151b974 100644
--- a/validation/linear/bitwise-cmpu.c
+++ b/validation/linear/bitwise-cmpu.c
@@ -8,7 +8,6 @@ static int gtu(bu32 x, bu32 y) { return (x > y); }
/*
* check-name: bitwise-cmpu
* check-command: test-linearize -Wno-decl $file
- * check-known-to-fail
*
* check-output-ignore
* check-output-excludes: setlt\\.