Message ID | 20231004120019.93101-8-philmd@linaro.org |
---|---|
State | Superseded |
Headers | show
Delivered-To: patch@linaro.org Received: by 2002:a5d:4a4e:0:b0:31d:da82:a3b4 with SMTP id v14csp303620wrs; Wed, 4 Oct 2023 05:03:30 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEk7NWXnig86QeKl7i4Csq39F0j3kM3PD+FOvIiUwEyeKXvVBnYSWnAVRNhXLg3DrmPUb4e X-Received: by 2002:aca:1219:0:b0:3a4:57a7:b30e with SMTP id 25-20020aca1219000000b003a457a7b30emr2167840ois.26.1696421009783; Wed, 04 Oct 2023 05:03:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696421009; cv=none; d=google.com; s=arc-20160816; b=pkeq65BySA822hFT0TBjC641Bm59QOFdUaWfxYI3Csd4Ym0BrNuanEJBTtjjK3R3p/ Z+/7hLTmUigKA4tmCsJSHH23kUfua1A/hBzCLZywyn48/yF7qHTqVlOYy34nljzEXed8 lZiqlJxGx87x0d75Be/tRioI1pDn2KiBETOrAN9Iu8i1QAvUqi3NKRv+lFcgjlD9bYkX 0tmsbtscVTgvz6dB1ifQ/STuo0v668mCTebKRXuHpF2lyLBKmSdfvvz0RZee7WGns+Ws HlwkftCPcm4hTnjKKz9Qlt1dv5aHIFXbHptwDORaeCGJyae3I0rKIBTo6mDL9xK5UEVa Vg2g== 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:cc:to :from:dkim-signature; bh=6gKDMfa7dSai1h/sgemtp7pr068K3EYlzpE9zbZdHuU=; fh=O3z/qjtWbp5mez4JaaarIdaa+p1KfZs0wGnyIdzJiqY=; b=VsiewDjJUsN1lOFI2avTpqhs7ReIJRh7qZ/lh7bHaLazizvpFPTVkGfZ+Fs/EKoBZy 7f5cmbozYLWmQDmz8+TnyhiwsXhfmxgR+J41zRRpEn5CuN3spPU2sX1Lc9mY9yCKaFKu v9wois7Anb8wnFgSj+MDQWkl/5w2VNgWxpsaPC8nT5ueUK9E2eZCG1sAhfdT+3WvoLsJ Y94/MA1fiBd7suFx9sjHIE+P3oD+K9yAxBZM+jpf7leytaNAwN19fkeAOsU+8J/tS89j Z89EovfK1gAgRQEvtpl9eR2ux3XpygOVqNM3otcTH8+PXLnn9GVuv43aTvhGbrlK6oZR HKEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mo8FY6sU; 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: <qemu-devel-bounces+patch=linaro.org@nongnu.org> Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id x18-20020a0cb212000000b0065af39cfc39si1374393qvd.331.2023.10.04.05.03.29 for <patch@linaro.org> (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 04 Oct 2023 05:03:29 -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=mo8FY6sU; 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] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <qemu-devel-bounces@nongnu.org>) id 1qo0as-0001uI-7d; Wed, 04 Oct 2023 08:03:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <philmd@linaro.org>) id 1qo0ZC-0000Jz-66 for qemu-devel@nongnu.org; Wed, 04 Oct 2023 08:01:33 -0400 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <philmd@linaro.org>) id 1qo0Ys-00012m-KC for qemu-devel@nongnu.org; Wed, 04 Oct 2023 08:01:24 -0400 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-406609df1a6so20681565e9.3 for <qemu-devel@nongnu.org>; Wed, 04 Oct 2023 05:01:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696420865; x=1697025665; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=6gKDMfa7dSai1h/sgemtp7pr068K3EYlzpE9zbZdHuU=; b=mo8FY6sUjvXEI+5WT3rHqjr27ipxS/Lyohoh/ucQp3aePWMB+9BoVReAoao4i2Frc6 LyZyWBNxTNZXo1+VBNMyXCOHbc/3d1dAwm4s7CoRB0ljYLUpjXKfdGQu6fWZpeoIBT9R XN9+I85rlIbjUFdn2mH+HTDCxwWGiD8Tv+ea9WhFejOHtCcnNxzyFr/TGAgFCdWsELP/ NRcp19LHyAlJ7zncwyQ8xDUFhlxpkr0y+Of1xiEtRqfCnPTXi+eK0X7lQqFUCsp/XN+V 6UIpJYpH8JAg6phGVm2EFxazHWGyvhvONyynIBC9f1PuzAaPB4XmdKf36D4a6NmZFpKA MszQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696420865; x=1697025665; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6gKDMfa7dSai1h/sgemtp7pr068K3EYlzpE9zbZdHuU=; b=UtsvYD0QpP9yT68iUVUAkI8fFtC1v7MXD7xRIDAOsxavpCH658pXaJxfwySzyXlydN 7FcuD7MOHf28HGxD6lFGYvL3G5rGe04yLr2hutstPmArgZTv7iFU07OOBgIeRJND8H4k LxRJd1C70mDMy3ivKK9VHM5/pp1r+FT90j9lQBi0rtTZ1Lc5+R9Rs9HxJfXAl2w0PjOF ywVwgC72kgJAsLQWKy5PwEcR4XTxDxo86LCLYcgYezhw08kTGueHu3LxsgsryAUDEoiJ 3FD8BBD7FvKunoQ9qD84C62BAokmtDy3L69hNzbEcbeIqj+6bbbyjZKMgDehvcrL3dSi y1/Q== X-Gm-Message-State: AOJu0Yz5K1kBeYo8wm++eADLV99XxNIVniYLrtEv6rqYeZnlT661U7MN BcdICeckHpbo2L5Kf737fbZThmzvPdNUG53d4o8= X-Received: by 2002:a05:600c:2287:b0:400:57d1:4911 with SMTP id 7-20020a05600c228700b0040057d14911mr2041971wmf.16.1696420864999; Wed, 04 Oct 2023 05:01:04 -0700 (PDT) Received: from m1x-phil.lan (5ep85-h01-176-173-163-52.dslam.bbox.fr. [176.173.163.52]) by smtp.gmail.com with ESMTPSA id r2-20020a05600c320200b0040641ce36a8sm1453822wmp.1.2023.10.04.05.01.03 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 04 Oct 2023 05:01:04 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= <philmd@linaro.org> To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, Markus Armbruster <armbru@redhat.com>, Thomas Huth <thuth@redhat.com>, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= <philmd@linaro.org>, Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com> Subject: [PATCH v3 07/16] qemu-io: Clean up global variable shadowing Date: Wed, 4 Oct 2023 14:00:10 +0200 Message-ID: <20231004120019.93101-8-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231004120019.93101-1-philmd@linaro.org> References: <20231004120019.93101-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=philmd@linaro.org; helo=mail-wm1-x331.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, SPF_HELO_NONE=0.001, T_SPF_TEMPERROR=0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <https://lists.nongnu.org/archive/html/qemu-devel> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org |
Series |
(few more) Steps towards enabling -Wshadow
|
expand
|
On Wed, Oct 04, 2023 at 02:00:10PM +0200, Philippe Mathieu-Daudé wrote: > Fix: > > qemu-io.c:478:36: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] > static void add_user_command(char *optarg) > ^ > /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/getopt.h:77:14: note: previous declaration is here > extern char *optarg; /* getopt(3) external variables */ > ^ > > Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> > --- > qemu-io.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > Reviewed-by: Eric Blake <eblake@redhat.com>
diff --git a/qemu-io.c b/qemu-io.c index 2bd7bfb650..050c70835f 100644 --- a/qemu-io.c +++ b/qemu-io.c @@ -475,10 +475,10 @@ static int command_loop(void) return last_error; } -static void add_user_command(char *optarg) +static void add_user_command(char *user_cmd) { cmdline = g_renew(char *, cmdline, ++ncmdline); - cmdline[ncmdline-1] = optarg; + cmdline[ncmdline - 1] = user_cmd; } static void reenable_tty_echo(void)
Fix: qemu-io.c:478:36: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] static void add_user_command(char *optarg) ^ /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/getopt.h:77:14: note: previous declaration is here extern char *optarg; /* getopt(3) external variables */ ^ Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> --- qemu-io.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)