From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id x+z9KaLBBWBOIgAAWB0awg (envelope-from ) for ; Mon, 18 Jan 2021 12:13:06 -0500 Received: by simark.ca (Postfix, from userid 112) id 9D1E01EF80; Mon, 18 Jan 2021 12:13:06 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_NONE,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from sourceware.org (unknown [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 4C6F41E940 for ; Mon, 18 Jan 2021 12:13:06 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 98CDA3864877; Mon, 18 Jan 2021 17:13:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 98CDA3864877 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1610989985; bh=3WB0i+KLsOgxgqin1CLikcLceXFRoukw88aRQA9giEY=; h=Date:To:Subject:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=txz3QVtxc+iW+x77eGZ3UyF0zm7XwWwCiTy1DQTcmpqfBurxJ0P0Ay4eGRrms15p3 X/LpkDE0m4S6IMSg550e5z8Atze+ikPX3xQZIg/mOctAdzsbX0qd8sWE4clSAuAOaC rduzPHIb6QcbXB8S8sVRhx2/z1c4xSSFfyOTdQO0= Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) by sourceware.org (Postfix) with ESMTP id 4DEA53861032 for ; Mon, 18 Jan 2021 17:13:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 4DEA53861032 Received: from vapier (localhost [127.0.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 6E87D340FEF; Mon, 18 Jan 2021 17:13:00 +0000 (UTC) Date: Mon, 18 Jan 2021 12:13:00 -0500 To: Simon Marchi Subject: Re: [PATCH] sim: common: modernize gennltvals.sh Message-ID: Mail-Followup-To: Simon Marchi , gdb-patches@sourceware.org References: <20210117101044.32143-1-vapier@gentoo.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: 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: Mike Frysinger via Gdb-patches Reply-To: Mike Frysinger Cc: gdb-patches@sourceware.org Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" On 18 Jan 2021 09:04, Simon Marchi wrote: > On 2021-01-17 5:10 a.m., Mike Frysinger via Gdb-patches wrote: > > It's not 1996 anymore, so stop writing shell code like it is, and > > rewrite it with modern POSIX shell standards. This makes it much > > more user friendly. > > > > Then regenerate the file with latest newlib sources to verify. > > > > * Makefile.in (headers): Change args to gennltvals.sh. > > * gennltvals.sh: Rewrite from scratch. > > * gentvals.sh: Delete. > > * nltvals.def: Regen. > > I suggest running shellcheck on the file an fixing what it complains about. i had run shellcheck and the only warnings (about unquoted expansion) i didn't think we worth fixing because of the limited scope of the script. the variable in question isn't accepting user input, it's operating on fixed inputs, and if we restrict ourselves to POSIX shell (which i think we do), then our options are limited, and imo the alternatives make it harder to read/understand. i debated writing this in python3, but that seems even less uncommon in the tree as a build tool. -mike