public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jonathan Wakely <jwakely@redhat.com>
To: Alexandre Oliva <oliva@adacore.com>
Cc: Jakub Jelinek <jakub@redhat.com>,
	gcc-patches@gcc.gnu.org, libstdc++@gcc.gnu.org
Subject: Re: [PATCH] [PR77760] [libstdc++] encode __time_get_state in tm
Date: Thu, 23 Feb 2023 18:21:46 +0000	[thread overview]
Message-ID: <CACb0b4nXg7kkt0Cnrss_tDs--0VWbNONzq9WTVfeVUJBF-v9aQ@mail.gmail.com> (raw)
In-Reply-To: <orv8jsb71a.fsf@lxoliva.fsfla.org>

On Thu, 23 Feb 2023 at 17:55, Alexandre Oliva <oliva@adacore.com> wrote:
>
> On Feb 22, 2023, Alexandre Oliva <oliva@adacore.com> wrote:
>
> >> Just curious, why doesn't the pmf hack work on arm-vxworks7?
>
> > At first, I thought we were running into this just because we have to
> > define __clang__ because of some vxworks system headers aimed at clang.
> > But even as I tried to drop the #ifndef, the test still failed; I
> > suspected it had to do with ARM's encoding of ptrmemfunc_vbit_in_delta,
> > but I did not confirm that this was the case.
>
> It was much simpler than that: patching locale_facets_nonio.tcc did not
> affect the code generated for the tests, even though the modified
> definition was present in the preprocessed version, and the patch didn't
> cause locale-inst.o to be rebuilt.
>
>
> With a build from scratch, the following patchlet is enough for time_get
> tests to pass for us, and I assume we'll have to keep on carrying such
> local changes, but I wonder if it would make sense to submit a patch to
> adjust all preprocessor tests for __clang__ in libstdc++ to also test
> for __clang_major__.
>
> --- a/libstdc++-v3/include/bits/locale_facets_nonio.tcc
> +++ b/libstdc++-v3/include/bits/locale_facets_nonio.tcc
> @@ -1465,7 +1465,7 @@ _GLIBCXX_END_NAMESPACE_LDBL_OR_CXX11
>        ctype<_CharT> const& __ctype = use_facet<ctype<_CharT> >(__loc);
>        __err = ios_base::goodbit;
>        bool __use_state = false;
> -#if __GNUC__ >= 5 && !defined(__clang__)
> +#if __GNUC__ >= 5 && !(defined(__clang__) && defined(__clang_major__))
>  #pragma GCC diagnostic push
>  #pragma GCC diagnostic ignored "-Wpmf-conversions"
>        // Nasty hack.  The C++ standard mandates that get invokes the do_get

Yeah, we can do that ... but it would be annoying.

We can't rely on __GNUC__ because other compilers pretend to be GCC
(and clang now allows you to fake any value of __GNUC__ with the
-fgcc-version flag), and we can't use __clang__, because other
compilers now pretend to be clang ... where does it end?


      reply	other threads:[~2023-02-23 18:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-17  7:47 Alexandre Oliva
2023-02-17 12:56 ` Jakub Jelinek
2023-02-22 14:27   ` Alexandre Oliva
2023-02-23 17:55     ` Alexandre Oliva
2023-02-23 18:21       ` Jonathan Wakely [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=CACb0b4nXg7kkt0Cnrss_tDs--0VWbNONzq9WTVfeVUJBF-v9aQ@mail.gmail.com \
    --to=jwakely@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.com \
    --cc=libstdc++@gcc.gnu.org \
    --cc=oliva@adacore.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).