diff options
| author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2020-05-13 22:32:04 +0200 |
|---|---|---|
| committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2020-05-21 17:27:46 +0200 |
| commit | 384008074a8d8881fefaa4fdda330120385d1259 (patch) | |
| tree | b7987270b948da703c344bd9918a7c4e5dc435f4 /validation | |
| parent | d89355c8ec5761eecc18a46c48f254feee8c9234 (diff) | |
| download | sparse-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.c | 6 |
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 * |
