From patchwork Tue Jul 26 15:20:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 593453 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:b811:0:0:0:0 with SMTP id fc17csp3644544mab; Tue, 26 Jul 2022 08:25:37 -0700 (PDT) X-Google-Smtp-Source: AGRyM1u7D8lHBLfXo9oqpe/1TJOuc9Yjku0ACIBXaqu7S37+zQogt2vrwsbZqNVDVFGOFYmey4v7 X-Received: by 2002:ad4:596a:0:b0:474:99d:e65f with SMTP id eq10-20020ad4596a000000b00474099de65fmr14838246qvb.63.1658849137068; Tue, 26 Jul 2022 08:25:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658849137; cv=none; d=google.com; s=arc-20160816; b=vuZHnl9hXfPP+TrS3elaqZFc8qaMt73XKYaZVpfn99KE+TlpG8cr7hg/A/QobKOFYr Aaz/8/Kh/h0nam+VdFfc5c1daPR5y1dvgFrcvUz7uXYhJ44i8ndCDcVwsQPazB5l5vaN enHa43f3sny7W8fED6dc0eDD66Gy8ODI4MZ31pOW7h3LvHq2+fi4PyCA2eLSsRQJxjdh JlRsIJOcA4klV7K3Z3Htvk4HbDpCeIjaE2ybTr0/LsSLlYK5hQ8myYpwzE7BNFdyTsuN OlNXHYmXj8Xaz8s8H76Mj0f5RNiCp1ieNDOA0o8NzE7T2uW3WHBg9ofG4A0u13afnpny +FSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=4EXt2WFXE+cYyllwhs3b3h+DGb3HVin2P2P0aToXQ9g=; b=bBCsVFnJQgKhmCOl5LOFeflJ7ge7AOuE/KtuKvhFTKvCWnAptg+JCe9IDyNovW/m5v h4TJGVjONKrIN9sSNHOzFdQHj16TBYvgbHceb0zx4Nl+Db0e5OzgPEsKKnjAb6PNefER Q2Dan0AZfDtv+/ZekbYRy4AIoDlcArRDpEVdmRaVxKiqk+VDurIULCppFRm0sEDgIOHI ig3QecScM0EBrWBljlqgzO7vGNjw+aZTLd88JqTooEjOQXz5AdcpxdXS+NCyOXK8IHjx f2Lveo54NCuDO8pCY1/VYmxCEM0cWGL4ou1CqsLvWVOSRt53GHTl3n89loRVy3taYmHo pFLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NQnkdnNN; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id c5-20020ac87d85000000b0031eced89afdsi8249903qtd.517.2022.07.26.08.25.37 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 26 Jul 2022 08:25:37 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NQnkdnNN; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:43688 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oGMRE-0003sR-K5 for patch@linaro.org; Tue, 26 Jul 2022 11:25:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51970) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oGMMG-0006Ri-Ov for qemu-devel@nongnu.org; Tue, 26 Jul 2022 11:20:28 -0400 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]:39849) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oGMMA-000633-NE for qemu-devel@nongnu.org; Tue, 26 Jul 2022 11:20:28 -0400 Received: by mail-wr1-x42d.google.com with SMTP id d8so20534592wrp.6 for ; Tue, 26 Jul 2022 08:20:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=4EXt2WFXE+cYyllwhs3b3h+DGb3HVin2P2P0aToXQ9g=; b=NQnkdnNNOpifRbydF7sNu+aOYdbAErmwB1+i+S/ZluHU1e+gQ2UKskz6Z3sl5ohs8F c71b81H5X+/9klDtwv8tnWwuDJ0E6FiQYRAVRydmv0N6CYhxzWxTBAitc3HULva2Tr6e XG35INE9hc4rVUTgJXVAU79EWDIx8a4dCNfgFWx7y9xZbmUCcdebEI1BsKZP7zQvWItr M8ewAv99rM5YBe9vssrxWsElTgrX18GW/r779s9hkSOCPCWWfdKtrU1G7uw/ZMu8EwGH jhMArMVKOgZYVK0ZKTmcwg6b5a0ssaTvvZ9g5jCmwMM2RxGhfiX8OtJQMRn5fAnmvLRQ ehmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=4EXt2WFXE+cYyllwhs3b3h+DGb3HVin2P2P0aToXQ9g=; b=dcc4V8Gb2CAxEKVej/TOubK2C5XX1HFCUOopWUiF8e5MQHLlyodZ3hciaIy7dC/xhh 0Ej3nxsX/ylqBYdix4MA+0V6rTO5xenk94wwbGLmhiLaAJi4kYr8wopvQNoYus9te4Yy HlIiyN1jzRwzRW+5GW2p9rgz1ioerV5KGMiK2c4knjXrvbDqAYAdF95l8QEDQjz7Lg9w 8xF68idjk1p9K8XC77NRvYMLlMJeTAz96vwhgvNKyTj9GlfrugMvBCTwpPuXC+phkeXF rOuRrojfHY4gSLOJky4s0UPaz5SEvrA1puEyqFpkVnmA8N1mh1GQ8nK7lIadjYSVd1CM CAxA== X-Gm-Message-State: AJIora9pFm+RNlq2Ih4ws305Y7fILxuABrr2nVLVBNteh5Lz5fIKUc7t wKR93kfNqPVZfr2Xi1JtO0GWZDKT3iM8lA== X-Received: by 2002:adf:f807:0:b0:21e:5094:aeb9 with SMTP id s7-20020adff807000000b0021e5094aeb9mr11520016wrp.497.1658848820103; Tue, 26 Jul 2022 08:20:20 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id n5-20020a1c2705000000b003a1980d55c4sm21932739wmn.47.2022.07.26.08.20.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Jul 2022 08:20:19 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 5/9] configure: Add braces to clarify intent of $emu[[:space:]] Date: Tue, 26 Jul 2022 16:20:08 +0100 Message-Id: <20220726152012.1631158-6-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220726152012.1631158-1-peter.maydell@linaro.org> References: <20220726152012.1631158-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01, T_SPF_TEMPERROR=0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" In shell script syntax, $var[something] is not special for variable expansion: $var is expanded. However, as it can look as if it were intended to be an array element access (the correct syntax for which is ${var[something]}), shellcheck recommends using explicit braces around ${var} to clarify the intended expansion. This fixes the warning: In ./configure line 2346: if "$target_ld" -verbose 2>&1 | grep -q "^[[:space:]]*$emu[[:space:]]*$"; then ^-- SC1087: Use braces when expanding arrays, e.g. ${array[idx]} (or ${var}[.. to quiet). Signed-off-by: Peter Maydell Reviewed-by: Thomas Huth Message-id: 20220720152631.450903-3-peter.maydell@linaro.org --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure b/configure index dec6f030346..a56c3d921be 100755 --- a/configure +++ b/configure @@ -2343,7 +2343,7 @@ if test -n "$target_cc" && # emulation. Linux and OpenBSD/amd64 use 'elf_i386'; FreeBSD uses the _fbsd # variant; OpenBSD/i386 uses the _obsd variant; and Windows uses i386pe. for emu in elf_i386 elf_i386_fbsd elf_i386_obsd i386pe; do - if "$target_ld" -verbose 2>&1 | grep -q "^[[:space:]]*$emu[[:space:]]*$"; then + if "$target_ld" -verbose 2>&1 | grep -q "^[[:space:]]*${emu}[[:space:]]*$"; then ld_i386_emulation="$emu" break fi