[PATCH][RFC] Re: sparse handles int64_t type wrong

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I took a stab at it.  It seems that direct_declarator() does handle
attributes, but it does not change the ctype to the declarator.
It is kind of awkward that the type is already build when it hit
the attribute in the end. It need to go back to overwrite
the already parsed type.

I have this patch seems make the test case happy. I am not sure
this is correct or not.
 
Chris
 

Index: sparse/parse.c
===================================================================
--- sparse.orig/parse.c	2006-12-12 21:12:29.000000000 -0800
+++ sparse/parse.c	2006-12-12 21:12:47.000000000 -0800
@@ -837,6 +837,10 @@ static struct token *handle_attributes(s
 			struct ctype thistype = { 0, };
 			token = attribute_specifier(token->next, &thistype);
 			apply_ctype(token->pos, &thistype, ctype);
+			if (is_int_type(ctype->base_type) && ctype->modifiers & MOD_SPECIFIER) {
+				ctype->base_type = ctype_integer(ctype->modifiers);
+				ctype->modifiers &= ~MOD_SPECIFIER;
+			}
 			continue;
 		}
 		if (match_idents(token, &asm_ident, &__asm_ident, &__asm___ident)) {
Index: sparse/show-parse.c
===================================================================
--- sparse.orig/show-parse.c	2006-12-12 21:12:29.000000000 -0800
+++ sparse/show-parse.c	2006-12-12 21:12:47.000000000 -0800
@@ -98,7 +98,7 @@ const char *modifier_string(unsigned lon
 	const char *res,**ptr, *names[] = {
 		"auto", "register", "static", "extern",
 		"const", "volatile", "[signed]", "[unsigned]",
-		"[char]", "[short]", "[long]", "[long]",
+		"[char]", "[short]", "[long]", "[long long]",
 		"[typdef]", "[structof]", "[unionof]", "[enum]",
 		"[typeof]", "[attribute]", "inline", "[addressable]",
 		"[nocast]", "[noderef]", "[accessed]", "[toplevel]",
Index: sparse/test-parsing.c
===================================================================
-
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux