diff mbox series

[4/9] spec: improve parsing of __int128

Message ID 20191111134747.79516-5-luc.vanoostenryck@gmail.com (mailing list archive)
State Mainlined, archived
Headers show
Series simplify parsing of specifiers | expand

Commit Message

Luc Van Oostenryck Nov. 11, 2019, 1:47 p.m. UTC
__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>
---
 parse.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/parse.c b/parse.c
index 797b3971e..c71f34a39 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,