diff options
| author | Paolo Bonzini <pbonzini@redhat.com> | 2025-02-14 09:29:22 +0100 |
|---|---|---|
| committer | Jussi Pakkanen <jpakkane@gmail.com> | 2025-02-16 22:09:44 +0200 |
| commit | eca1ac18dc1978b15b500c9f1710c05cb1ccc0ec (patch) | |
| tree | 259500084f4fb306497bcf22854c74f0c5a05d22 /mesonbuild/compilers | |
| parent | 7f8bef1ad7199fb05e58cc6d7a49b64a3c24c757 (diff) | |
| download | meson-eca1ac18dc1978b15b500c9f1710c05cb1ccc0ec.tar.gz | |
c: add -Wno-vla-larger-than to the exceptions for -Wno*
When supplying -Wno-vla-larger-than to compiler.get_supported_arguments,
meson will inject -Wvla-larger-than as an argument which considered
invalid by GCC, as the converse argument is -Wvla-larger-than=<value>.
Just like CLikeCompiler._has_multi_arguments special-cases
-Wno-attributes=, do the same for -Wno-vla-larger-than.
Resolves: https://github.com/mesonbuild/meson/issues/14208
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'mesonbuild/compilers')
| -rw-r--r-- | mesonbuild/compilers/mixins/clike.py | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/mesonbuild/compilers/mixins/clike.py b/mesonbuild/compilers/mixins/clike.py index 4792a8a03..385883432 100644 --- a/mesonbuild/compilers/mixins/clike.py +++ b/mesonbuild/compilers/mixins/clike.py @@ -1285,10 +1285,16 @@ class CLikeCompiler(Compiler): # some compilers, e.g. GCC, don't warn for unsupported warning-disable # flags, so when we are testing a flag like "-Wno-forgotten-towel", also # check the equivalent enable flag too "-Wforgotten-towel". - # Make an exception for -Wno-attributes=x as -Wattributes=x is invalid - # for GCC at least. - if arg.startswith('-Wno-') and not arg.startswith('-Wno-attributes='): - new_args.append('-W' + arg[5:]) + if arg.startswith('-Wno-'): + # Make an exception for -Wno-attributes=x as -Wattributes=x is invalid + # for GCC at least. Also, the opposite of -Wno-vla-larger-than is + # -Wvla-larger-than=N + if arg.startswith('-Wno-attributes='): + pass + elif arg == '-Wno-vla-larger-than': + new_args.append('-Wvla-larger-than=1000') + else: + new_args.append('-W' + arg[5:]) if arg.startswith('-Wl,'): mlog.warning(f'{arg} looks like a linker argument, ' 'but has_argument and other similar methods only ' |
