Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compiler.get_supported_arguments rejects -Wno-vla-larger-than on gcc-like compilers #14208

Open
mitchgrout opened this issue Jan 30, 2025 · 0 comments
Assignees

Comments

@mitchgrout
Copy link

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>.

This appears to be an intentional choice in ‎CLikeCompiler._has_multi_arguments, as it special-cases -Wno-attributes=.

To Reproduce

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
@mitchgrout mitchgrout changed the title compiler.get_supported_arguments fails with -Wno-vla-larger-than compiler.get_supported_arguments rejects -Wno-vla-larger-than on gcc-like compilers Jan 30, 2025
@bonzini bonzini self-assigned this Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants