From 6232b8434815919cea8b0f7dca4652567ccb6c84 Mon Sep 17 00:00:00 2001 From: Felix Willgerodt Date: Mon, 18 Jul 2022 10:55:18 +0200 Subject: [PATCH] gdb, testsuite: Enable testcases that suppress specific warnings, for icc/icx. To cite gdb.exp: Some C/C++ testcases unconditionally pass -Wno-foo as additional options to disable some warning. That is OK with GCC, because by design, GCC accepts any -Wno-foo option, even if it doesn't support -Wfoo. Clang however warns about unknown -Wno-foo by default, unless you pass -Wno-unknown-warning-option as well. We do that here, so that individual testcases don't have to worry about it. This patch adds the same option that already exists for clang for icx and adds the equivalent icc option. --- gdb/testsuite/lib/gdb.exp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index ef34983bb51..17523f82996 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -4489,9 +4489,13 @@ proc gdb_compile {source dest type options} { && [lsearch -exact $options rust] == -1 && [lsearch -exact $options ada] == -1 && [lsearch -exact $options f90] == -1 - && [lsearch -exact $options go] == -1 - && [test_compiler_info "clang-*"]} { - lappend new_options "additional_flags=-Wno-unknown-warning-option" + && [lsearch -exact $options go] == -1} { + if {[test_compiler_info "clang-*"] || [test_compiler_info "icx-*"]} { + lappend new_options "additional_flags=-Wno-unknown-warning-option" + } elseif {[test_compiler_info "icc-*"]} { + # This is the equivalent for the icc compiler. + lappend new_options "additional_flags=-diag-disable=10148" + } } # Treating .c input files as C++ is deprecated in Clang, so -- 2.30.2