public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jonathan Wakely <jwakely@redhat.com>
To: Jakub Jelinek <jakub@redhat.com>
Cc: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org
Subject: Re: [committed] libstdc++: Fix uses of non-reserved names in headers
Date: Thu, 16 Feb 2023 12:02:47 +0000	[thread overview]
Message-ID: <CACb0b4nU-zsRE0_gjw3ALyiUObOnd3CmNESE+jnCWCFJF56iMA@mail.gmail.com> (raw)
In-Reply-To: <Y+4XVVcFMbHG3imy@tucnak>

On Thu, 16 Feb 2023 at 11:45, Jakub Jelinek <jakub@redhat.com> wrote:
>
> On Thu, Feb 16, 2023 at 11:47:54AM +0100, Jakub Jelinek via Gcc-patches wrote:
> > On Thu, Feb 16, 2023 at 10:30:30AM +0000, Jonathan Wakely via Gcc-patches wrote:
> > > Tested powerpc64le-linux. Pushed to trunk.
> > >
> > > These should be backported too.
> > >
> > > -- >8 --
> > >
> > > The non-reserved names 'val' and 'dest' were being used in our headers
> > > but haven't been added to the 17_intro/names.cc test. That's because
> > > they are used by <asm-generic/posix_types.h> and <netinet/tcp.h>
> > > respecitvely on glibc-based systems.
> >
> > So, can't we for such problematic names add hacks, like some directory
> > which the test adds as -isystem before the standard ones and contains
>
> Or do it the way you just did for PSTL, by including all the non-libstdc++
> headers used in libstdc++ headers before defining all the macros for the
> non-reserved names, hopefully the system headers use include guards and
> won't be included again.


Yes, I tried that last week, and it didn't work. There was a
diagnostic about __GLIBCXX__ being redefined, because of the {
dg-add-options no_pch } directive.

I can try again, or we can just use the existing solution of doing
#undef val #undef dest for glibc and/or linux targets, so that we
still test those names on other targets.


  reply	other threads:[~2023-02-16 12:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-16 10:30 Jonathan Wakely
2023-02-16 10:47 ` Jakub Jelinek
2023-02-16 11:45   ` Jakub Jelinek
2023-02-16 12:02     ` Jonathan Wakely [this message]
2023-02-16 12:00   ` Jonathan Wakely
2023-02-16 13:23 Maciej Cencora

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=CACb0b4nU-zsRE0_gjw3ALyiUObOnd3CmNESE+jnCWCFJF56iMA@mail.gmail.com \
    --to=jwakely@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.com \
    --cc=libstdc++@gcc.gnu.org \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).