From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com [IPv6:2a00:1450:4864:20::62b]) by sourceware.org (Postfix) with ESMTPS id 6FD753858D37 for ; Wed, 10 Aug 2022 10:47:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 6FD753858D37 Received: by mail-ej1-x62b.google.com with SMTP id tl27so26988551ejc.1 for ; Wed, 10 Aug 2022 03:47:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc; bh=4Z5mGXPiY9BuNap6jF7oSnmfO/toULhrzfmX/VMcEG4=; b=IY58tymONeYfv5zim3ThztYha7ckBIuMPSwMaqv1lL27g2TTSxiPzgMtoDvkpORG4p /ji7jxXpda2/YEUhJRvAAsOqApwc2Bqszbi17Z53iAD4FusWfHrwB7+XwwbVCvQBnFwP Bbkti1roUOXiRo2Iw/7c5BJFSnvrBVPO3uYx3pjcnrwR08X1QND3B9H9EDB/wC/uPswV rog+6+bBif5rvnoVSlJncJ6/LwznFO3tlh3CnMJy/tb8PAok50umR2Vy1ULYqTd7a1Ji mMB5D95FsLCfhBCLf0m5MceIIJNtLPDH7I5TYbtEAOU9z2+yOeBLoNbW/qPX3vafxl8M cl1w== X-Gm-Message-State: ACgBeo3lMJFMfQB5YyHGH4Bvn4c0q2Nfg1Izh5NuAC6h5QiFuybuIY13 T6SPZ9Nj6XWTcUapBZdVWGnOHTwIbh36+3Z7FAw= X-Google-Smtp-Source: AA6agR6bRnDbGJ0Utb9Mt08jNTwD9PI/zvQDZFfW3R6MbGfp7zynCkiE0Z2UR8ZRG+zrXmo0ZjGhixymkYjfx3JpzBg= X-Received: by 2002:a17:907:6295:b0:703:92b8:e113 with SMTP id nd21-20020a170907629500b0070392b8e113mr20263893ejc.594.1660128459147; Wed, 10 Aug 2022 03:47:39 -0700 (PDT) MIME-Version: 1.0 References: <7b34d4a1-4f34-cffb-8b5f-eb3424ca1049@suse.cz> <82e413fb-d592-3885-9d93-28c717921523@suse.cz> In-Reply-To: From: Richard Biener Date: Wed, 10 Aug 2022 12:47:27 +0200 Message-ID: Subject: Re: [PATCH 1/3] Factor out jobserver_active_p. To: =?UTF-8?Q?Martin_Li=C5=A1ka?= Cc: GCC Patches Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Aug 2022 10:47:42 -0000 On Wed, Aug 10, 2022 at 11:30 AM Martin Li=C5=A1ka wrote: > > On 8/10/22 09:47, Richard Biener wrote: > > On Wed, Aug 10, 2022 at 9:17 AM Martin Li=C5=A1ka wrot= e: > >> > >> 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 tha= t > >> 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 th= e 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 =3D 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 >