meson: clang: add -Wno-wc2y-extensions

Recent clang versions warn on __COUNTER__, unless compiling with
-std=c2y (which breaks other things).

"Fixes" '__COUNTER__' is a C2y extension (__COUNTER__ is used by our
UNITTEST macro).
This commit is contained in:
Daniel Eklöf 2026-03-10 07:59:40 +01:00
parent f49fdf7ca3
commit 4fd682b4e8
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -12,6 +12,11 @@ is_debug_build = get_option('buildtype').startswith('debug')
cc = meson.get_compiler('c')
# Newer clang versions warns when using __COUNTER__ without -std=c2y
if cc.has_argument('-Wc2y-extensions')
add_project_arguments('-Wno-c2y-extensions', language: 'c')
endif
if cc.has_function('memfd_create',
args: ['-D_GNU_SOURCE'],
prefix: '#include <sys/mman.h>')