public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] Testsuite changes for clang and icc/icx.
@ 2022-07-25 11:38 Felix Willgerodt
  2022-07-25 11:38 ` [PATCH v2 1/2] gdb, testsuite: Enable testcases that suppress specific warnings, for icc/icx Felix Willgerodt
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Felix Willgerodt @ 2022-07-25 11:38 UTC (permalink / raw)
  To: gdb-patches

V1 was only one patch and can be found here:
https://sourceware.org/pipermail/gdb-patches/2022-June/189903.html
When discussing this patch, we discovered that the float/double change in
callfuncs.c was actually not really necessary. Hence I removed it in V2.

V2 also adds a new patch to add "-Wno-unknown-warning-option" for icc and icx
compilation in the testsuite, similar to how it is already done for clang.
This enables more tests to run with icc and icx.

Felix Willgerodt (2):
  gdb, testsuite: Enable testcases that suppress specific warnings, for
    icc/icx.
  gdb, testsuite: Adapt gdb.base/callfuncs.exp for new clang warning.

 gdb/testsuite/gdb.base/callfuncs.exp |  2 +-
 gdb/testsuite/lib/gdb.exp            | 10 +++++++---
 2 files changed, 8 insertions(+), 4 deletions(-)

-- 
2.34.3

Intel Deutschland GmbH
Registered Address: Am Campeon 10, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de <http://www.intel.de>
Managing Directors: Christin Eisenschmid, Sharon Heck, Tiffany Doon Silva  
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v2 1/2] gdb, testsuite: Enable testcases that suppress specific warnings, for icc/icx.
  2022-07-25 11:38 [PATCH v2 0/2] Testsuite changes for clang and icc/icx Felix Willgerodt
@ 2022-07-25 11:38 ` Felix Willgerodt
  2022-07-27  1:07   ` Kevin Buettner
  2022-07-25 11:38 ` [PATCH v2 2/2] gdb, testsuite: Adapt gdb.base/callfuncs.exp for new clang warning Felix Willgerodt
  2022-07-25 11:45 ` [PATCH v2 0/2] Testsuite changes for clang and icc/icx Willgerodt, Felix
  2 siblings, 1 reply; 6+ messages in thread
From: Felix Willgerodt @ 2022-07-25 11:38 UTC (permalink / raw)
  To: gdb-patches

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 a8f25b5f0dd..1d4ac75016e 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -4484,9 +4484,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.34.3

Intel Deutschland GmbH
Registered Address: Am Campeon 10, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de <http://www.intel.de>
Managing Directors: Christin Eisenschmid, Sharon Heck, Tiffany Doon Silva  
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v2 2/2] gdb, testsuite: Adapt gdb.base/callfuncs.exp for new clang warning.
  2022-07-25 11:38 [PATCH v2 0/2] Testsuite changes for clang and icc/icx Felix Willgerodt
  2022-07-25 11:38 ` [PATCH v2 1/2] gdb, testsuite: Enable testcases that suppress specific warnings, for icc/icx Felix Willgerodt
@ 2022-07-25 11:38 ` Felix Willgerodt
  2022-07-27  1:12   ` Kevin Buettner
  2022-07-25 11:45 ` [PATCH v2 0/2] Testsuite changes for clang and icc/icx Willgerodt, Felix
  2 siblings, 1 reply; 6+ messages in thread
From: Felix Willgerodt @ 2022-07-25 11:38 UTC (permalink / raw)
  To: gdb-patches

Clang 15.0.0 added a new warning for deprecated non-prototype functions:
https://reviews.llvm.org/D122895
Callfuncs.exp is impacted and won't run due to new warnings:

callfuncs.c:339:5: warning: a function declaration without a prototype is
deprecated in all versions of C and is not supported in C2x
[-Wdeprecated-non-prototype]
int t_float_values (float_arg1, float_arg2)

This patch disables those warnings with -Wno-deprecated-non-prototype.
Removing the test for deprecated syntax would also be an option. But I will
leave that up for others to decide.
---
 gdb/testsuite/gdb.base/callfuncs.exp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gdb/testsuite/gdb.base/callfuncs.exp b/gdb/testsuite/gdb.base/callfuncs.exp
index 4448cc127ba..d74357b8b48 100644
--- a/gdb/testsuite/gdb.base/callfuncs.exp
+++ b/gdb/testsuite/gdb.base/callfuncs.exp
@@ -18,7 +18,7 @@
 
 standard_testfile
 
-set compile_flags {debug}
+set compile_flags {debug additional_flags=-Wno-deprecated-non-prototype}
 if [support_complex_tests] {
     lappend compile_flags "additional_flags=-DTEST_COMPLEX"
 }
-- 
2.34.3

Intel Deutschland GmbH
Registered Address: Am Campeon 10, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de <http://www.intel.de>
Managing Directors: Christin Eisenschmid, Sharon Heck, Tiffany Doon Silva  
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928


^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [PATCH v2 0/2] Testsuite changes for clang and icc/icx.
  2022-07-25 11:38 [PATCH v2 0/2] Testsuite changes for clang and icc/icx Felix Willgerodt
  2022-07-25 11:38 ` [PATCH v2 1/2] gdb, testsuite: Enable testcases that suppress specific warnings, for icc/icx Felix Willgerodt
  2022-07-25 11:38 ` [PATCH v2 2/2] gdb, testsuite: Adapt gdb.base/callfuncs.exp for new clang warning Felix Willgerodt
@ 2022-07-25 11:45 ` Willgerodt, Felix
  2 siblings, 0 replies; 6+ messages in thread
From: Willgerodt, Felix @ 2022-07-25 11:45 UTC (permalink / raw)
  To: gdb-patches; +Cc: Andrew Burgess, Bruno Larsen

Sorry, I forgot to CC you when sending out my follow-up series.

Felix

> -----Original Message-----
> From: Willgerodt, Felix <felix.willgerodt@intel.com>
> Sent: Montag, 25. Juli 2022 13:38
> To: gdb-patches@sourceware.org
> Cc: Willgerodt, Felix <felix.willgerodt@intel.com>
> Subject: [PATCH v2 0/2] Testsuite changes for clang and icc/icx.
> 
> V1 was only one patch and can be found here:
> https://sourceware.org/pipermail/gdb-patches/2022-June/189903.html
> When discussing this patch, we discovered that the float/double change in
> callfuncs.c was actually not really necessary. Hence I removed it in V2.
> 
> V2 also adds a new patch to add "-Wno-unknown-warning-option" for icc and
> icx
> compilation in the testsuite, similar to how it is already done for clang.
> This enables more tests to run with icc and icx.
> 
> Felix Willgerodt (2):
>   gdb, testsuite: Enable testcases that suppress specific warnings, for
>     icc/icx.
>   gdb, testsuite: Adapt gdb.base/callfuncs.exp for new clang warning.
> 
>  gdb/testsuite/gdb.base/callfuncs.exp |  2 +-
>  gdb/testsuite/lib/gdb.exp            | 10 +++++++---
>  2 files changed, 8 insertions(+), 4 deletions(-)
> 
> --
> 2.34.3

Intel Deutschland GmbH
Registered Address: Am Campeon 10, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de <http://www.intel.de>
Managing Directors: Christin Eisenschmid, Sharon Heck, Tiffany Doon Silva  
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2 1/2] gdb, testsuite: Enable testcases that suppress specific warnings, for icc/icx.
  2022-07-25 11:38 ` [PATCH v2 1/2] gdb, testsuite: Enable testcases that suppress specific warnings, for icc/icx Felix Willgerodt
@ 2022-07-27  1:07   ` Kevin Buettner
  0 siblings, 0 replies; 6+ messages in thread
From: Kevin Buettner @ 2022-07-27  1:07 UTC (permalink / raw)
  To: gdb-patches

On Mon, 25 Jul 2022 13:38:21 +0200
Felix Willgerodt via Gdb-patches <gdb-patches@sourceware.org> wrote:

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

Okay.

Kevin


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2 2/2] gdb, testsuite: Adapt gdb.base/callfuncs.exp for new clang warning.
  2022-07-25 11:38 ` [PATCH v2 2/2] gdb, testsuite: Adapt gdb.base/callfuncs.exp for new clang warning Felix Willgerodt
@ 2022-07-27  1:12   ` Kevin Buettner
  0 siblings, 0 replies; 6+ messages in thread
From: Kevin Buettner @ 2022-07-27  1:12 UTC (permalink / raw)
  To: gdb-patches

On Mon, 25 Jul 2022 13:38:22 +0200
Felix Willgerodt via Gdb-patches <gdb-patches@sourceware.org> wrote:

> Clang 15.0.0 added a new warning for deprecated non-prototype functions:
> https://reviews.llvm.org/D122895
> Callfuncs.exp is impacted and won't run due to new warnings:
> 
> callfuncs.c:339:5: warning: a function declaration without a prototype is
> deprecated in all versions of C and is not supported in C2x
> [-Wdeprecated-non-prototype]
> int t_float_values (float_arg1, float_arg2)
> 
> This patch disables those warnings with -Wno-deprecated-non-prototype.
> Removing the test for deprecated syntax would also be an option. But I will
> leave that up for others to decide.

This approach seems reasonable to me.  However, I think you should
move at least some of the explanation provided above into a (new) comment
just before the line added by your patch.

> ---
>  gdb/testsuite/gdb.base/callfuncs.exp | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/gdb/testsuite/gdb.base/callfuncs.exp b/gdb/testsuite/gdb.base/callfuncs.exp
> index 4448cc127ba..d74357b8b48 100644
> --- a/gdb/testsuite/gdb.base/callfuncs.exp
> +++ b/gdb/testsuite/gdb.base/callfuncs.exp
> @@ -18,7 +18,7 @@
>  
>  standard_testfile
>  
> -set compile_flags {debug}
> +set compile_flags {debug additional_flags=-Wno-deprecated-non-prototype}
>  if [support_complex_tests] {
>      lappend compile_flags "additional_flags=-DTEST_COMPLEX"
>  }
> -- 
> 2.34.3
> 
> Intel Deutschland GmbH
> Registered Address: Am Campeon 10, 85579 Neubiberg, Germany
> Tel: +49 89 99 8853-0, www.intel.de <http://www.intel.de>
> Managing Directors: Christin Eisenschmid, Sharon Heck, Tiffany Doon Silva  
> Chairperson of the Supervisory Board: Nicole Lau
> Registered Office: Munich
> Commercial Register: Amtsgericht Muenchen HRB 186928
> 


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-07-27  1:12 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-25 11:38 [PATCH v2 0/2] Testsuite changes for clang and icc/icx Felix Willgerodt
2022-07-25 11:38 ` [PATCH v2 1/2] gdb, testsuite: Enable testcases that suppress specific warnings, for icc/icx Felix Willgerodt
2022-07-27  1:07   ` Kevin Buettner
2022-07-25 11:38 ` [PATCH v2 2/2] gdb, testsuite: Adapt gdb.base/callfuncs.exp for new clang warning Felix Willgerodt
2022-07-27  1:12   ` Kevin Buettner
2022-07-25 11:45 ` [PATCH v2 0/2] Testsuite changes for clang and icc/icx Willgerodt, Felix

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).