aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2019-11-11 00:29:27 +0100
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2019-11-11 13:53:46 +0100
commitc04f113be723564844ec7132f3d1b4155e0fa7c6 (patch)
tree2bc44f52326fe41c6bb8f061ffcadcd36e9631ab
parent4c3567c2a7bf578995f598455b3219016aca3b82 (diff)
downloadsparse-c04f113be723564844ec7132f3d1b4155e0fa7c6.tar.gz
spec: improve parsing of __int128
__int128 is processed as-if 'long' is applied to a 'long long'-like type. But this is not necessary or desirable: better to be more direct and process it as a kind of 'long long long' type. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
-rw-r--r--parse.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/parse.c b/parse.c
index 797b3971..c71f34a3 100644
--- a/parse.c
+++ b/parse.c
@@ -300,9 +300,9 @@ static struct symbol_op long_op = {
};
static struct symbol_op int128_op = {
- .type = KW_SPECIFIER | KW_LONG,
+ .type = KW_SPECIFIER,
.test = Set_S|Set_T|Set_Char|Set_Short|Set_Int|Set_Float|Set_Double|Set_Long|Set_Vlong|Set_Int128,
- .set = Set_T|Set_Int128,
+ .set = Set_T|Set_Int128|Set_Vlong,
.class = CInt,
};
@@ -1624,12 +1624,12 @@ static struct token *declaration_specifiers(struct token *token, struct decl_sta
}
seen |= s->op->set;
class += s->op->class;
- if (s->op->set & Set_Int128)
- size = 2;
if (s->op->type & KW_SHORT) {
size = -1;
} else if (s->op->set & Set_Char) {
size = -2;
+ } else if (s->op->set & Set_Int128) {
+ size = 3;
} else if (s->op->type & KW_LONG && size++) {
if (class == CReal) {
specifier_conflict(token->pos,