public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <richard.guenther@gmail.com>
To: "Martin Liška" <mliska@suse.cz>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH 1/3] Factor out jobserver_active_p.
Date: Wed, 10 Aug 2022 12:47:27 +0200	[thread overview]
Message-ID: <CAFiYyc0ZGw1HWsXO881o-pA-LrbWV1kHqaz=EBLZsp8jSE=2cw@mail.gmail.com> (raw)
In-Reply-To: <bbbf9dc7-4195-6308-9dc1-f33da6c47403@suse.cz>

On Wed, Aug 10, 2022 at 11:30 AM Martin Liška <mliska@suse.cz> wrote:
>
> On 8/10/22 09:47, Richard Biener wrote:
> > On Wed, Aug 10, 2022 at 9:17 AM Martin Liška <mliska@suse.cz> wrote:
> >>
> >> On 8/10/22 08:56, Richard Biener wrote:
> >>> C++ standard library includes have to go through system.h (#define
> >>> INCLUDE_STRING).
> >>
> >> Oh, yeah. That means I need to rely on the flat header files :/
> >>
> >>>
> >>> Does the API really have to use std::string?
> >>
> >> I would like to. My main motivation is std::string::rfind function that
> >> has no C equivalent (would be rstrstr).
> >
> > The old code happily uses strstr though, not worrying about
> > finding the last instance of --jobserver-auth?
>
> Yes, sorry, I forgot to mention that, it's something I was notified by the GNU make
> developer here: https://savannah.gnu.org/bugs/index.php?57242#comment13
>
> >
> > Anyway, I'm not going to insist - I just noticed the actual
> > users use .c_str on the error message and adjusting the
> > environment for a not working jobserver is done
> > inconsistently.  Since I'm coming from C I was more
> > expecting sth like
> >
> >  bool jobserver_active = probe_jobserver (true /* diagnose */);
>
> Well, the main problem is that I need to "extra" a bunch of information
> when parsing the env variable (and each consumer needs something else,
> so that's why the jobserver_info members). It was very ugly having all
> these return values being given as params (of pointer type).

Yeah, fair enough.

> Martin
>
> >
> > rather than pulling in a class instance from an all-inline
> > implementation.  But hey ;)
> >
> >
> >>
> >> Martin
>

  reply	other threads:[~2022-08-10 10:47 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-09 12:00 Martin Liška
2022-08-10  6:56 ` Richard Biener
2022-08-10  7:17   ` Martin Liška
2022-08-10  7:47     ` Richard Biener
2022-08-10  9:30       ` Martin Liška
2022-08-10 10:47         ` Richard Biener [this message]
2022-08-10 11:11           ` Martin Liška
2022-08-10 11:51             ` Richard Biener

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='CAFiYyc0ZGw1HWsXO881o-pA-LrbWV1kHqaz=EBLZsp8jSE=2cw@mail.gmail.com' \
    --to=richard.guenther@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=mliska@suse.cz \
    /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).