From 1f41fab371d95201158f3b2811849723a3953c3c Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 24 Nov 2024 18:39:07 -0500 Subject: Suppress GCC Wstringop-overflow warning in atom overflow test In release builds, GCC 14.2.1 reports "error: writing 4 bytes into a region of size between 18446744073709551581 and 3". I'm pretty sure this is a compiler bug: the message suggests an underflow, the flagged code does have an overflow check (being the whole point of the test), and the test passes in both ASan and Valgrind. --- test/meson.build | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'test/meson.build') diff --git a/test/meson.build b/test/meson.build index f782441..502a44c 100644 --- a/test/meson.build +++ b/test/meson.build @@ -157,6 +157,11 @@ test_names = [ 'forge_overflow', ] +atom_test_suppressions = [] +if warning_level == 'everything' and cc.get_id() == 'gcc' + atom_test_suppressions += ['-Wno-stringop-overflow'] +endif + # Build and run tests foreach test_name : test_names test( @@ -164,7 +169,7 @@ foreach test_name : test_names executable( test_name, files('test_@0@.c'.format(test_name)), - c_args: c_suppressions, + c_args: c_suppressions + atom_test_suppressions, dependencies: [lv2_dep], ), suite: 'unit', -- cgit v1.2.1