Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: Keith Seitz <keiths@redhat.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH 2/2] [gdb/testsuite] Use Wno-non-c-typedef-for-linkage for gcc 16
Date: Sat, 30 May 2026 10:49:56 +0200	[thread overview]
Message-ID: <bb18d020-6bdd-4638-8fce-f606356381a4@suse.de> (raw)
In-Reply-To: <48defad3-5b7b-4e68-8367-1468fabaeee8@redhat.com>

On 5/29/26 6:25 PM, Keith Seitz wrote:
> 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.
> 

Hi Keith,

thanks for the reviews.

I've updated the comment to use "Clangs/GCCs".

I'll push this series after retesting on x86_64-linux.

Thanks,
- Tom

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


      reply	other threads:[~2026-05-30  8:50 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
2026-05-30  8:49     ` Tom de Vries [this message]

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=bb18d020-6bdd-4638-8fce-f606356381a4@suse.de \
    --to=tdevries@suse.de \
    --cc=gdb-patches@sourceware.org \
    --cc=keiths@redhat.com \
    /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