From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com [IPv6:2a00:1450:4864:20::631]) by sourceware.org (Postfix) with ESMTPS id E92373857C40 for ; Wed, 10 Aug 2022 07:47:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E92373857C40 Received: by mail-ej1-x631.google.com with SMTP id y13so26141785ejp.13 for ; Wed, 10 Aug 2022 00:47:51 -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=TrNea9BgA0SRGBxxjxDTILbAD0qwtqOcodv+urjHob0=; b=UVm0IHsq91AaNAaW6C8dEfji+s9WFMeQOT8zh+mloqpFcmB/V7foYBs9PxQ1N1Um88 e2sPvFWhP7/TGbDan07y/lcAQy+mf+3TQGTyGmG1blLg0JoKowaJmtQFi+R60WdiZcnj SND6+25rPUn7OUW2ozPusgrcMDuSRBcWTAi0Mz53XNRT5W1TXjuh2gT5PQcS/08nks8x hPlIdeGggwFVt8GePzN5Po9VBzQWfIC/djlTKeQ9Jx/jR2RM4m90C7Sy7DaVcU9syCbp B3MJYRyZVcz5nuyu3WacOVf5L0WLVQM0bmHIdSOtD8VKt1ipCAigKGgUa1xyEXlk5+Ii /2QA== X-Gm-Message-State: ACgBeo2a5GsCwXgpUMiLANTG0gOlsYvc8e1xr0QYiq4LIShbL/FTcZcw WBIeSaOZykkShlkBuJkywHs0DbB+XP7yrHTPhVI= X-Google-Smtp-Source: AA6agR4JaDjp+G6W1ynOToSClwkwjARpP6ON+Fp9pp51szW4Ogqi7LfRtjTocG6DQJaBLK0BD5ojLohlrR+DXJYlDcQ= X-Received: by 2002:a17:907:6295:b0:703:92b8:e113 with SMTP id nd21-20020a170907629500b0070392b8e113mr19817193ejc.594.1660117670595; Wed, 10 Aug 2022 00:47:50 -0700 (PDT) MIME-Version: 1.0 References: <7b34d4a1-4f34-cffb-8b5f-eb3424ca1049@suse.cz> <82e413fb-d592-3885-9d93-28c717921523@suse.cz> In-Reply-To: <82e413fb-d592-3885-9d93-28c717921523@suse.cz> From: Richard Biener Date: Wed, 10 Aug 2022 09:47:38 +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 07:47:53 -0000 On Wed, Aug 10, 2022 at 9:17 AM Martin Li=C5=A1ka 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? 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 */); rather than pulling in a class instance from an all-inline implementation. But hey ;) > > Martin