aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/validation
diff options
authorAl Viro <viro@ftp.linux.org.uk>2009-02-14 12:25:15 +0000
committerChristopher Li <sparse@chrisli.org>2009-07-17 23:06:22 +0000
commit9151897c4a2557382b4a4a64e1e3a0fae41747e0 (patch)
tree31b3563c8f6bcac673057eb60e38e13a13d47aba /validation
parent65f354637410d2c5d33a6ca425a67ceacdd7cea0 (diff)
downloadsparse-dev-9151897c4a2557382b4a4a64e1e3a0fae41747e0.tar.gz
Separate parsing of identifier-list (in K&R-style declarations)
Don't mix it with parameter-type-list, add saner checks. 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/identifier_list.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/validation/identifier_list.c b/validation/identifier_list.c
new file mode 100644
index 00000000..4691989c
--- /dev/null
+++ b/validation/identifier_list.c
@@ -0,0 +1,18 @@
+typedef int T;
+void f(...);
+void g(*);
+void h(x,int);
+void i_OK(T);
+void j(x,T);
+/*
+ * check-name: identifier-list parsing
+ * check-error-start
+identifier_list.c:2:8: warning: variadic functions must have one named argument
+identifier_list.c:3:8: error: Expected ) in function declarator
+identifier_list.c:3:8: error: got *
+identifier_list.c:4:9: error: Expected ) in function declarator
+identifier_list.c:4:9: error: got ,
+identifier_list.c:6:9: error: Expected ) in function declarator
+identifier_list.c:6:9: error: got ,
+ * check-error-end
+ */