aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/validation
diff options
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2016-11-02 22:59:37 +0100
committerChristopher Li <sparse@chrisli.org>2017-02-13 09:34:43 +0800
commitf25e41f4856b800d41a5d97122ed881a261deb50 (patch)
tree246403666ed1d4270ecd74122d512616aec5b9c7 /validation
parentd589636c2475bf049b518a55e1b0d8519335936d (diff)
downloadsparse-dev-f25e41f4856b800d41a5d97122ed881a261deb50.tar.gz
Warn on unknown attributes instead of throwing errors
GCC creates new attributes quite often, generaly for specific usages irrelevant to what sparse is used for. Throwing errors on these create needless noise and annoyance which is better to avoid. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com> Signed-off-by: Christopher Li <sparse@chrisli.org>
Diffstat (limited to 'validation')
-rw-r--r--validation/Wunknown-attribute-def.c9
-rw-r--r--validation/Wunknown-attribute-no.c9
-rw-r--r--validation/Wunknown-attribute-yes.c10
3 files changed, 28 insertions, 0 deletions
diff --git a/validation/Wunknown-attribute-def.c b/validation/Wunknown-attribute-def.c
new file mode 100644
index 00000000..0c0868d6
--- /dev/null
+++ b/validation/Wunknown-attribute-def.c
@@ -0,0 +1,9 @@
+static int foo(void) __attribute__((unknown_attribute));
+
+/*
+ * check-name: warn-unknown-attribute
+ *
+ * check-error-start
+Wunknown-attribute-def.c:1:37: warning: attribute 'unknown_attribute': unknown attribute
+ * check-error-end
+ */
diff --git a/validation/Wunknown-attribute-no.c b/validation/Wunknown-attribute-no.c
new file mode 100644
index 00000000..87951699
--- /dev/null
+++ b/validation/Wunknown-attribute-no.c
@@ -0,0 +1,9 @@
+static int foo(void) __attribute__((unknown_attribute));
+
+/*
+ * check-name: warn-unknown-attribute-no
+ * check-command: sparse -Wno-unknown-attribute $file
+ *
+ * check-error-start
+ * check-error-end
+ */
diff --git a/validation/Wunknown-attribute-yes.c b/validation/Wunknown-attribute-yes.c
new file mode 100644
index 00000000..72538cf5
--- /dev/null
+++ b/validation/Wunknown-attribute-yes.c
@@ -0,0 +1,10 @@
+static int foo(void) __attribute__((unknown_attribute));
+
+/*
+ * check-name: warn-unknown-attribute-yes
+ * check-command: sparse -Wunknown-attribute $file
+ *
+ * check-error-start
+Wunknown-attribute-yes.c:1:37: warning: attribute 'unknown_attribute': unknown attribute
+ * check-error-end
+ */