aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Viro <viro@www.linux.org.uk>2004-09-04 19:56:24 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-07 21:03:05 -0700
commit032f492af0ac27772a09c54f56a7ef2a8e06c1a0 (patch)
tree55b46a3c14d9a83d5388a90b59949e6981c5a056 /show-parse.c
parent[PATCH] parser.c cleanup (diff)
downloadsparse-032f492af0ac27772a09c54f56a7ef2a8e06c1a0.tar.gz
sparse-032f492af0ac27772a09c54f56a7ef2a8e06c1a0.tar.bz2
sparse-032f492af0ac27772a09c54f56a7ef2a8e06c1a0.zip
[PATCH] __attribute__((bitwise))
Handling of __attribute__((bitwise)) in a way that should be easy to extend afterwards. Example of use: typedef __u32 __attribute__((bitwise)) __le32; That will create a new 32bit type that will be assignment-incompatible with anything else. The set of allowed operations is restricted to bitwise ones, the only allowed constant is 0 right now. Forced casts are allowed, so is cast from type to itself and cast to void. Any other cast will give a warning. Checks are triggered by -Wbitwise in command line; if it's not there, attribute will be silently ignored.
Diffstat (limited to 'show-parse.c')
-rw-r--r--show-parse.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/show-parse.c b/show-parse.c
index 48043c4..f277e3d 100644
--- a/show-parse.c
+++ b/show-parse.c
@@ -230,6 +230,9 @@ static void do_show_type(struct symbol *sym, struct type_name *name)
case SYM_ARRAY:
break;
+ case SYM_RESTRICT:
+ break;
+
default:
prepend(name, "unknown type %d", sym->type);
return;
@@ -257,6 +260,11 @@ static void do_show_type(struct symbol *sym, struct type_name *name)
case SYM_ARRAY:
append(name, "[%lld]", get_expression_value(sym->array_size));
return;
+
+ case SYM_RESTRICT:
+ prepend(name, "restricted ");
+ return;
+
default:
break;
}