aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/validation
diff options
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2020-05-13 22:32:04 +0200
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2020-05-21 17:27:46 +0200
commit384008074a8d8881fefaa4fdda330120385d1259 (patch)
treeb7987270b948da703c344bd9918a7c4e5dc435f4 /validation
parentd89355c8ec5761eecc18a46c48f254feee8c9234 (diff)
downloadsparse-dev-384008074a8d8881fefaa4fdda330120385d1259.tar.gz
bad-label: respect attribute((unused))
Currently, attributes on labels were simply ignored. This was fine since nothing was done wth them anyway. But now that Sparse can give a warning for unused labels it would be nice to also support the attribute 'unused' not to issues the warning when not desired. So, add a small helper around handle_attributes() and use this instead of skipping the attributes. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'validation')
-rw-r--r--validation/label-unused.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/validation/label-unused.c b/validation/label-unused.c
index a654ef77..e3f255e1 100644
--- a/validation/label-unused.c
+++ b/validation/label-unused.c
@@ -13,6 +13,12 @@ l:
});
}
+static void baz(void)
+{
+l: __attribute__((unused));
+ return;
+}
+
/*
* check-name: label-unused
*