commit:     ddc2dc1bbb001d95bdf0ece36f379481c97156be
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Tue Oct  1 10:16:58 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Oct  1 10:16:58 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ddc2dc1b

toolchain.eclass: conditionally pass -Wno-complain-wrong-lang for >= GCC 13

... ditto for -Wno-format-security and so on. It causes far more noise
than test cases it helps with. Of course, when we have -Wno-complain-wrong-lang
available (in >= GCC 13), then it's worth it.

Signed-off-by: Sam James <sam <AT> gentoo.org>

 eclass/toolchain.eclass | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index 7b302afdf5cc..e253cffa777b 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -2171,8 +2171,10 @@ toolchain_src_test() {
        (
                # Workaround our -Wformat-security default which breaks
                # various tests as it adds unexpected warning output.
-               GCC_TESTS_CFLAGS+=" -Wno-format-security -Wno-format"
-               GCC_TESTS_CXXFLAGS+=" -Wno-format-security -Wno-format"
+               if tc_version_is_at_least 13 ; then
+                       GCC_TESTS_CFLAGS+=" -Wno-format-security -Wno-format"
+                       GCC_TESTS_CXXFLAGS+=" -Wno-format-security -Wno-format"
+               fi
 
                # Workaround our -Wtrampolines default which breaks
                # tests too.
@@ -2182,8 +2184,10 @@ toolchain_src_test() {
                GCC_TESTS_LDFLAGS+=" -Wl,--no-warn-execstack"
                # Avoid confusing tests like Fortran/C interop ones where
                # CFLAGS are used.
-               GCC_TESTS_CFLAGS+=" -Wno-complain-wrong-lang"
-               GCC_TESTS_CXXFLAGS+=" -Wno-complain-wrong-lang"
+               if tc_version_is_at_least 13 ; then
+                       GCC_TESTS_CFLAGS+=" -Wno-complain-wrong-lang"
+                       GCC_TESTS_CXXFLAGS+=" -Wno-complain-wrong-lang"
+               fi
 
                # Issues with Ada tests:
                # gnat.dg/align_max.adb

Reply via email to