From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id E2uLJEadDGJHJwAAWB0awg (envelope-from ) for ; Wed, 16 Feb 2022 01:44:22 -0500 Received: by simark.ca (Postfix, from userid 112) id 867731F3C9; Wed, 16 Feb 2022 01:44:22 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 26E681EA69 for ; Wed, 16 Feb 2022 01:44:22 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 03D9A385843E for ; Wed, 16 Feb 2022 06:44:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 03D9A385843E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1644993859; bh=tQUoEgGquerhvl8uPM4JJ6DIgvSoHQ1WSn+Dj1ihLtU=; h=To:In-Reply-To:Subject:References:Date:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=I2aypn8j0va/cn/AhyBePJpq3su4oo8C2Q+jZw834wzbesMjG01Ogu0OMKuuIdvsM /Ab4l4DH4Gy5jWRa9M+AYsSA+BQL1HOpZlTuy8nrp87AUJ90B5U71fdd+cFzWn2b0i YbYpCsUKVCxXffG7FpjVPF48FsQpGWw0mnKl54Ak= Received: from smtp1.axis.com (smtp1.axis.com [195.60.68.17]) by sourceware.org (Postfix) with ESMTPS id 2B2393858D3C for ; Wed, 16 Feb 2022 06:44:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2B2393858D3C To: Mike Frysinger In-Reply-To: (message from Mike Frysinger on Tue, 15 Feb 2022 23:57:00 -0500) Subject: Re: [PATCH 11/12] sim/testsuite/cris: Remove faulty use of basename in C tests MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8BIT References: <20220214225824.AC90A20439@pchp3.se.axis.com> <20220214230724.2C0AA20439@pchp3.se.axis.com> Message-ID: <20220216064400.0628320417@pchp3.se.axis.com> Date: Wed, 16 Feb 2022 07:44:00 +0100 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Hans-Peter Nilsson via Gdb-patches Reply-To: Hans-Peter Nilsson Cc: gdb-patches@sourceware.org Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" > Date: Tue, 15 Feb 2022 23:57:00 -0500 > From: Mike Frysinger > On 15 Feb 2022 00:07, Hans-Peter Nilsson via Gdb-patches wrote: > > --- a/sim/testsuite/cris/c/stat3.c > > +++ b/sim/testsuite/cris/c/stat3.c > > @@ -7,13 +7,14 @@ > > #include > > #include > > #include > > +#define mybasename(x) ({ const char *x_ = (x), *y_ = strrchr (x_, '/'); y_ != NULL ? y_ + 1 : x_; }) > > > > int main (int argc, char *argv[]) > > { > > char path[1024] = "/"; > > struct stat buf; > > > > - strcat (path, basename (argv[0])); > > + strcat (path, mybasename(argv[0])); > > GNU style (and this file style) says to put space before the ( > -mike Now that's a nit if ever I saw one; it's in the test-suite! Committed. --- 8< --- sim/testsuite/cris/c/stat3.c: Fix formatting nit * c/stat3.c (main): Fix formatting nit. --- sim/testsuite/cris/c/stat3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sim/testsuite/cris/c/stat3.c b/sim/testsuite/cris/c/stat3.c index f7c96045832c..321da1b2bd61 100644 --- a/sim/testsuite/cris/c/stat3.c +++ b/sim/testsuite/cris/c/stat3.c @@ -14,7 +14,7 @@ int main (int argc, char *argv[]) char path[1024] = "/"; struct stat buf; - strcat (path, mybasename(argv[0])); + strcat (path, mybasename (argv[0])); if (stat (".", &buf) != 0 || !S_ISDIR (buf.st_mode)) abort (); -- 2.30.2