aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAl Viro <viro@ftp.linux.org.uk>2009-03-09 23:32:36 +0000
committerChristopher Li <sparse@chrisli.org>2009-07-18 05:30:09 +0000
commit47567023ae85e9c8428585da298e6d6613a86ab1 (patch)
tree6922e78595ef0c3636b83fc7930aa808ae61eeb3 /validation
parentFix declaration_specifiers() handling of typedef name shadowed by NS_SYMBOL (diff)
downloadsparse-47567023ae85e9c8428585da298e6d6613a86ab1.tar.gz
sparse-47567023ae85e9c8428585da298e6d6613a86ab1.tar.bz2
sparse-47567023ae85e9c8428585da298e6d6613a86ab1.zip
Fix __label__ handling
a) __label__ in gcc is not a type, it's a statement. Accepted in the beginning of compound-statement, has form __label__ ident-list; b) instead of crapping into NS_SYMBOL namespace (and consequent shadowing issues), reassign the namespace to NS_LABEL after we'd bound it. We'll get block scope and label namespace, i.e. what we get in gcc. c) MOD_LABEL can be dropped now. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Christopher Li <sparse@chrisli.org>
Diffstat (limited to 'validation')
-rw-r--r--validation/label-scope.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/validation/label-scope.c b/validation/label-scope.c
new file mode 100644
index 0000000..7af3d91
--- /dev/null
+++ b/validation/label-scope.c
@@ -0,0 +1,12 @@
+static int f(int n)
+{
+ __label__ n;
+n: return n;
+}
+static int g(int n)
+{
+n: return n;
+}
+/*
+ * check-name: __label__ scope
+ */