[PATCH] add testcase for array size type difference

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

 



Currently, type_difference() ignore array sizes.

Add some testcases for this.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx>
---
 validation/typediff-arraysize.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
 create mode 100644 validation/typediff-arraysize.c

diff --git a/validation/typediff-arraysize.c b/validation/typediff-arraysize.c
new file mode 100644
index 000000000..dd7a2ca5a
--- /dev/null
+++ b/validation/typediff-arraysize.c
@@ -0,0 +1,12 @@
+extern int ok0[];	int ok0[1];	// OK
+extern int ok1[1];	int ok1[];	// OK but size should be 1
+extern int ko1[1];	int ko1[2];	// KO
+
+/*
+ * check-name: typediff-arraysize
+ * check-known-to-fail
+ *
+ * check-error-start
+typediff-arraysize.c:3:29: error: symbol 'ko1' redeclared with different type (originally declared at typediff-arraysize.c:3) - different array sizes
+ * check-error-end
+ */
-- 
2.16.3

--
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