aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/validation
diff options
authorHans Verkuil <hans.verkuil@cisco.com>2014-04-03 11:17:11 -0700
committerChristopher Li <sparse@chrisli.org>2014-04-03 11:23:22 -0700
commit488f14955196fab95bb3a834c9979a24cc4cb390 (patch)
tree138106933673f6af13c975585eed899d944aa85d /validation
parent6e71132697e13a56625bac0bc51392e8f819c6de (diff)
downloadsparse-dev-488f14955196fab95bb3a834c9979a24cc4cb390.tar.gz
Add test case for extern array
Has report this bug which fix by Linus in the previous commit. Sparse will report "cannot size expression" on the array size. It is cause by the second extern declare with imcompleted size. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Christopher Li <sparse@chrisli.org>
Diffstat (limited to 'validation')
-rw-r--r--validation/extern-array.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/validation/extern-array.c b/validation/extern-array.c
new file mode 100644
index 00000000..58bc7ae6
--- /dev/null
+++ b/validation/extern-array.c
@@ -0,0 +1,14 @@
+extern const char *v4l2_type_names[];
+const char *v4l2_type_names[] = {
+ "test"
+};
+extern const char *v4l2_type_names[];
+
+static void test(void)
+{
+ unsigned sz = sizeof(v4l2_type_names);
+}
+/*
+ * check-name: duplicate extern array
+ */
+