meson.build: add -Wno-unused-variables when buildling with clang

The test suite makes a lot of use of this pattern:
	_unref_(ei_event) *ev = peck_ei_event(....)

Most of the work is done in the peck function, with the caller just
needing cleanup. Unfortunately clang sees this as unused variable and
insists on warning about all of them.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2022-03-01 15:09:15 +10:00
parent ca34a091ac
commit 60523606cf

View file

@ -30,6 +30,17 @@ cflags =[
'-Wstrict-overflow=2',
'-Wswitch',
]
if cc.get_id() == 'clang'
cflags += [
# clang doesn't think just using _unref_ is a use of the variable
# _unref_(foo) *bar = something_that_gives_a_ref
# but we make heavy use of that in the test suite for convenience
# of events we know must exist but we don't care about specifically
'-Wno-unused-variable',
]
endif
add_project_arguments(cc.get_supported_arguments(cflags), language: 'c')
config_h = configuration_data()