From: Keith Seitz <keiths@redhat.com>
To: Tom de Vries <tdevries@suse.de>, gdb-patches@sourceware.org
Subject: Re: [PATCH 2/2] [gdb/testsuite] Use Wno-non-c-typedef-for-linkage for gcc 16
Date: Fri, 29 May 2026 09:25:22 -0700 [thread overview]
Message-ID: <48defad3-5b7b-4e68-8367-1468fabaeee8@redhat.com> (raw)
In-Reply-To: <20260529125149.2027857-3-tdevries@suse.de>
Hi,
On 5/29/26 5:51 AM, Tom de Vries wrote:
> With gcc 16 and test-case gdb.cp/classes.exp I run into:
> ...
> classes.cc:440:15: warning: anonymous non-C-compatible type given name for linkage purposes by 'typedef' declaration [-Wnon-c-typedef-for-linkage]^M
> 440 | typedef class {^M
> | ^^M
> | DynamicBase2^M
> classes.cc:443:15: note: type is not C-compatible because it contains 'virtual int DynamicBase2::get_x()' declaration^M
> 443 | virtual int get_x () { return x; }^M
> | ^~~~~^M
> ...
>
> Fix this by applying Wno-non-c-typedef-for-linkage, which is already done for
> clang.
>
> Likewise for gdb.cp/class2.exp.
This LGTM, just one little nit.
> diff --git a/gdb/testsuite/gdb.cp/class2.exp b/gdb/testsuite/gdb.cp/class2.exp
> index 705f51ac3e0..aa2a04467f4 100644
> --- a/gdb/testsuite/gdb.cp/class2.exp
> +++ b/gdb/testsuite/gdb.cp/class2.exp
> @@ -21,7 +21,8 @@ standard_testfile .cc
> set flags [list debug c++]
> # When using recent Clangs, this test fails to compile without this warning
> # being disabled. However, older Clangs fail to recognize the flag.
This comment could use a small update.
> -if { [gcc_major_version "clang-*" "c++"] > 10 } {
> +if { [gcc_major_version "clang-*" "c++"] > 10
> + || [gcc_major_version "gcc-*" "c++"] >= 16} {
> lappend flags additional_flags=-Wno-non-c-typedef-for-linkage
> }
>
Reviewed-By: Keith Seitz <keiths@redhat.com>
Thank you for fixing these.
Keith
next prev parent reply other threads:[~2026-05-29 16:25 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-29 12:51 [PATCH 0/2] [gdb/testsuite] Handle " Tom de Vries
2026-05-29 12:51 ` [PATCH 1/2] [gdb/testsuite] Fix ambiguous operator warning Tom de Vries
2026-05-29 16:23 ` Keith Seitz
2026-05-29 12:51 ` [PATCH 2/2] [gdb/testsuite] Use Wno-non-c-typedef-for-linkage for gcc 16 Tom de Vries
2026-05-29 16:25 ` Keith Seitz [this message]
2026-05-30 8:49 ` Tom de Vries
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=48defad3-5b7b-4e68-8367-1468fabaeee8@redhat.com \
--to=keiths@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=tdevries@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox