Skip to content

Conversation

@bonzini
Copy link
Collaborator

@bonzini bonzini commented Feb 14, 2025

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

Just like CLikeCompiler._has_multi_arguments special-cases -Wno-attributes=, do the same for -Wno-vla-larger-than.

Resolves: #14208

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: mesonbuild#14208
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
@bonzini bonzini added this to the 1.7.1 milestone Feb 14, 2025
if arg.startswith('-Wno-attributes='):
pass
elif arg == '-Wno-vla-larger-than':
new_args.append('-Wvla-larger-than=1000')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why 1000 specifically?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It wants a number, and I just put something that would make sense to pass. It is not used since the compiler does not see any VLA during this invocation.

@jpakkane jpakkane merged commit eca1ac1 into mesonbuild:master Feb 16, 2025
32 of 33 checks passed
@bonzini bonzini deleted the issue14208 branch May 23, 2025 21:06
helehto added a commit to helehto/meson that referenced this pull request Jul 27, 2025
Commit eca1ac1 (mesonbuild#14252) added support
for properly detecting the -Wno-vla-larger-than flag: a value must be
specified for its positive form (-Wvla-larger-than=N), or GCC will exit
with the error "missing argument to ‘-Walloc-size-larger-than=’".

There is a handful of other -Wno-* flags whose positive form act in the
same manner, but are not covered here:

  * -Wno-alloc-size-larger-than (GCC >=7.1.0)
  * -Wno-alloca-larger-than (GCC >=7.1.0)
  * -Wno-frame-larger-than (GCC >=4.4.0)
  * -Wno-stack-usage (GCC >=4.7.0)

Add logic to treat these in the same way.

Signed-off-by: Henrik Lehtonen <eigengrau@vm86.se>
helehto added a commit to helehto/meson that referenced this pull request Jul 27, 2025
Commit eca1ac1 (mesonbuild#14252) added support
for properly detecting the -Wno-vla-larger-than flag: a value must be
specified for its positive form (-Wvla-larger-than=N), or GCC will exit
with the error "missing argument to ‘-Walloc-size-larger-than=’".

There is a handful of other -Wno-* flags whose positive form act in the
same manner, but are not covered here:

  * -Wno-alloc-size-larger-than (GCC >=7.1.0)
  * -Wno-alloca-larger-than (GCC >=7.1.0)
  * -Wno-frame-larger-than (GCC >=4.4.0)
  * -Wno-stack-usage (GCC >=4.7.0)

Add logic to treat these in the same way.

Signed-off-by: Henrik Lehtonen <eigengrau@vm86.se>
jpakkane pushed a commit that referenced this pull request Jul 28, 2025
Commit eca1ac1 (#14252) added support
for properly detecting the -Wno-vla-larger-than flag: a value must be
specified for its positive form (-Wvla-larger-than=N), or GCC will exit
with the error "missing argument to ‘-Walloc-size-larger-than=’".

There is a handful of other -Wno-* flags whose positive form act in the
same manner, but are not covered here:

  * -Wno-alloc-size-larger-than (GCC >=7.1.0)
  * -Wno-alloca-larger-than (GCC >=7.1.0)
  * -Wno-frame-larger-than (GCC >=4.4.0)
  * -Wno-stack-usage (GCC >=4.7.0)

Add logic to treat these in the same way.

Signed-off-by: Henrik Lehtonen <eigengrau@vm86.se>
eli-schwartz pushed a commit that referenced this pull request Jul 29, 2025
Commit eca1ac1 (#14252) added support
for properly detecting the -Wno-vla-larger-than flag: a value must be
specified for its positive form (-Wvla-larger-than=N), or GCC will exit
with the error "missing argument to ‘-Walloc-size-larger-than=’".

There is a handful of other -Wno-* flags whose positive form act in the
same manner, but are not covered here:

  * -Wno-alloc-size-larger-than (GCC >=7.1.0)
  * -Wno-alloca-larger-than (GCC >=7.1.0)
  * -Wno-frame-larger-than (GCC >=4.4.0)
  * -Wno-stack-usage (GCC >=4.7.0)

Add logic to treat these in the same way.

Signed-off-by: Henrik Lehtonen <eigengrau@vm86.se>
(cherry picked from commit e501a22)
eli-schwartz pushed a commit that referenced this pull request Jul 29, 2025
Commit eca1ac1 (#14252) added support
for properly detecting the -Wno-vla-larger-than flag: a value must be
specified for its positive form (-Wvla-larger-than=N), or GCC will exit
with the error "missing argument to ‘-Walloc-size-larger-than=’".

There is a handful of other -Wno-* flags whose positive form act in the
same manner, but are not covered here:

  * -Wno-alloc-size-larger-than (GCC >=7.1.0)
  * -Wno-alloca-larger-than (GCC >=7.1.0)
  * -Wno-frame-larger-than (GCC >=4.4.0)
  * -Wno-stack-usage (GCC >=4.7.0)

Add logic to treat these in the same way.

Signed-off-by: Henrik Lehtonen <eigengrau@vm86.se>
(cherry picked from commit e501a22)
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

Successfully merging this pull request may close these issues.

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

2 participants