You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
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>.
project('tmp', 'c')
c =meson.get_compiler('c')
c.get_supported_arguments(
'-Wno-vla-larger-than',
checked: 'require',
)
With a gcc-like compiler, run meson setup build and observe the output:
ERROR: Compiler for C does not support "-Wno-vla-larger-than"
From meson-logs.txt:
Command line: `gcc <dir>/testfile.c -o <dir>/output.obj -c -D_FILE_OFFSET_BITS=64 -O0 -Wvla-larger-than -Wno-vla-larger-than` -> 1
stderr:
gcc: error: unrecognized command line option '-Wvla-larger-than'; did you mean '-Wvla-larger-than='?
-----------
Compiler for C supports arguments -Wno-vla-larger-than: NO
Expected behavior meson considers the argument valid if accepted by the compiler, even if the converse is rejected
system parameters
Is this a cross build or just a plain native build (for the same computer)? -- Plain, but would affect any build type
what operating system (e.g. MacOS Catalina, Windows 10, CentOS 8.0, Ubuntu 18.04, etc.) -- WSL2 under Windows 10
what Python version are you using e.g. 3.8.0 -- 3.8.10
what meson --version -- 1.1.0
what ninja --version if it's a Ninja build -- 1.10.0
The text was updated successfully, but these errors were encountered:
mitchgrout
changed the title
compiler.get_supported_arguments fails with -Wno-vla-larger-thancompiler.get_supported_arguments rejects -Wno-vla-larger-than on gcc-like compilers
Jan 30, 2025
Describe the bug
When supplying
-Wno-vla-larger-than
tocompiler.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>
.This appears to be an intentional choice in
CLikeCompiler._has_multi_arguments
, as it special-cases-Wno-attributes=
.To Reproduce
With a
gcc
-like compiler, runmeson setup build
and observe the output:From
meson-logs.txt
:Expected behavior
meson
considers the argument valid if accepted by the compiler, even if the converse is rejectedsystem parameters
meson --version
-- 1.1.0ninja --version
if it's a Ninja build -- 1.10.0The text was updated successfully, but these errors were encountered: