summaryrefslogtreecommitdiff
path: root/test cases
diff options
context:
space:
mode:
authorHenrik Lehtonen <eigengrau@vm86.se>2025-07-27 09:17:56 +0200
committerJussi Pakkanen <jussi.pakkanen@mailbox.org>2025-07-29 02:23:00 +0300
commite501a226e91df77d60d058c5d9efd33bd2b38f99 (patch)
treef3f9db78919d5eb75216f79f1a9fb0e6316fc919 /test cases
parent189c27ef815b717a854d2ecdda1851463a5deff3 (diff)
downloadmeson-e501a226e91df77d60d058c5d9efd33bd2b38f99.tar.gz
c: add more exceptions to -Wno-*
Commit eca1ac18dc1978b15b500c9f1710c05cb1ccc0ec (#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>
Diffstat (limited to 'test cases')
-rw-r--r--test cases/common/104 has arg/meson.build19
1 files changed, 16 insertions, 3 deletions
diff --git a/test cases/common/104 has arg/meson.build b/test cases/common/104 has arg/meson.build
index 466bed9df..500b8a9ad 100644
--- a/test cases/common/104 has arg/meson.build
+++ b/test cases/common/104 has arg/meson.build
@@ -56,9 +56,22 @@ if cpp.get_id() == 'gcc' and cpp.version().version_compare('>=12.1.0')
# Handle special -Wno-attributes=foo where -Wattributes=foo is invalid
# i.e. our usual -Wno-foo -Wfoo hack doesn't work for -Wattributes=foo.
assert(cpp.has_argument('-Wno-attributes=meson::i_do_not_exist'))
- # Likewise, the positive counterpart to -Wno-vla-larger-than is
- # -Wvla-larger-than=N
- assert(cpp.has_argument('-Wno-vla-larger-than'))
+endif
+
+if cpp.get_id() == 'gcc'
+ # Handle negative flags whose positive counterparts require a value to be
+ # specified.
+ if cpp.version().version_compare('>=4.4.0')
+ assert(cpp.has_argument('-Wno-frame-larger-than'))
+ endif
+ if cpp.version().version_compare('>=4.7.0')
+ assert(cpp.has_argument('-Wno-stack-usage'))
+ endif
+ if cpp.version().version_compare('>=7.1.0')
+ assert(cpp.has_argument('-Wno-alloc-size-larger-than'))
+ assert(cpp.has_argument('-Wno-alloca-larger-than'))
+ assert(cpp.has_argument('-Wno-vla-larger-than'))
+ endif
endif
if cc.get_id() == 'clang' and cc.version().version_compare('<=4.0.0')