From patchwork Wed Oct 4 12:00:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 729294 Delivered-To: patch@linaro.org Received: by 2002:a5d:4a4e:0:b0:31d:da82:a3b4 with SMTP id v14csp303910wrs; Wed, 4 Oct 2023 05:03:54 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHItocHuVpGMZiHzsgqzNQdrLkmb2zZBQwxKJVcaUkyr4wFNn4R0m3LdQD5UhPvv2qPQYKP X-Received: by 2002:a05:620a:2885:b0:76d:bc1b:c491 with SMTP id j5-20020a05620a288500b0076dbc1bc491mr2303378qkp.14.1696421033861; Wed, 04 Oct 2023 05:03:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696421033; cv=none; d=google.com; s=arc-20160816; b=njddXN4EpNGvXRZJ/ssROjX/VN4jaDwBDzJyJgbQXDadVAGoqSylCXJuv8sGHwyCDv Q9CTCyu7jP3Rnf13/8dNaXrgJZkPHNraKgI96L5XqGHTOzf9AsHYuxdkCLAvR2PcIDBD KMZAfEu4NnPbf4hcG+aeeEt90KDoW3+waDF3C2miRvrZzZzxWhYn76nYSlHU8wamJ+Ih CpfuNizkBy/fy7ohMT6zykaiYi5xHtoUirLou3XAuwFQDqpSL8Tss1HDJPCvXJKyDdo2 rgqhgO9GA3oBM9G210+oc+eMGZ3ujYHGTTkEXFLSvzgf4b4eT+m9DukyCKJ3m1Ez0/uR 0Kqg== 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=lY+2ZyI4HgMHia8dRE1/FWk+2Dlndzg7wEwrT1ttBuw=; fh=WMIdhHxQOE06Q0CA6hatwIdbwD5GPL7+epgCEEyumco=; b=OustblIc6GeKPxrJQBBzUC/Ssyh3Uv02nndmpp7FfYk49eAcPl5W+si5Mir/ip3BA6 UXPg5C4fawQaum5K/N4SyPmjq0Nel2GDxKV+Uu43V6Ayl/UtAUMemcCm/tJRjYv1lET6 yJlObrhVP2UuPFlVld25yOkl4JcE25ZbkX66iAdR32Hxch5MMgbEv4HoT0FG17gtVAuB SsOYbnKSWkaGzWVFSnTWaQMTg/q8ZM8QsXeweDGz+92VB8xYxNESUQXEpKzRh1KAp0Y6 znxc5EINgZA9sDNmTCn/dErPnyyjqoevvdac0XKtwOv2rnpa+VPnGnOzSC9/VzgQRvOG bNUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=F2pYlKQC; 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 oq5-20020a05620a610500b0076f18ae10e1si1361385qkn.395.2023.10.04.05.03.53 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 04 Oct 2023 05:03:53 -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=F2pYlKQC; 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 ) id 1qo0at-0001zY-6S; 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 ) id 1qo0ZB-0000Jm-6M for qemu-devel@nongnu.org; Wed, 04 Oct 2023 08:01:33 -0400 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qo0Z6-00014p-0z for qemu-devel@nongnu.org; Wed, 04 Oct 2023 08:01:22 -0400 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-405524e6768so19833055e9.2 for ; Wed, 04 Oct 2023 05:01:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696420878; x=1697025678; 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=lY+2ZyI4HgMHia8dRE1/FWk+2Dlndzg7wEwrT1ttBuw=; b=F2pYlKQC3xDPyDiLtmHNVWaEZwc5AWU+LZ/eMDfFDYEW//WQ2hUjKjfwfJBVfQn4wv 1jN/RYdJm4XQl102pFlZyhyWFSrR8I7naZn5HHhIXZZc3t3cODSvHRXD47Kdd1/OKofx 42bqVOBIMzruclo4sZcnA6vHITQldTbYQkKGLvap7E55wO9JAle6F38nQ/Mye+qxWEOb RdUyxRia1wf0JMAmSkFwZ/159ZFYbmQfeegVm84dR8X3a1ps1sjedW+WW8I3XoKi17e3 lVQ98P19Xw8RGbcJqUuQifAqToA5cf8JT8qvWcfmSdx8fsT3sLN8CVx4QVe+ol444MUN 2Atg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696420878; x=1697025678; 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=lY+2ZyI4HgMHia8dRE1/FWk+2Dlndzg7wEwrT1ttBuw=; b=JxJ7XF8Tcw6k1HSEGYGkgTBx1cfUoROKzdj5/XTO5t61a45H6VrwpUnQ/CH3s6gSW5 Z+YEW8P9vURjW5TELCP5NxJF9eyLB7g2oy1QlpxchlgvVYq6LWmTFPzVLBCu8+U95bzO JSX7n5fBjBVqSJIeILyP3zknrhXDQR5shVNQt87e5prMO6WNcckuFaLKct+K4tXNV3hY 6du8rvClpoX2E96AmUeVNLTywdaMAFm5xqcOXq2yPl1+g+OrUOPBKCtXOHB7NuHZlN8P CGo0dWFO1gt+7k9QPmTldTnNZTlIzSixCcnAlkVOzUg16wq1VfCmvCemXFrI1dIbvTU/ M8iw== X-Gm-Message-State: AOJu0Yw/WeUwkyFnipJGZNC5zJyT+qKpwQSRHfQiT8MN8mNCMQ69Bt5c RkHokpMthk+QM3gACLEUrcYVTvU3L/CFZ0HkBYY= X-Received: by 2002:a05:600c:6027:b0:406:8465:d299 with SMTP id az39-20020a05600c602700b004068465d299mr1518248wmb.7.1696420876973; Wed, 04 Oct 2023 05:01:16 -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 p7-20020adff207000000b003253523d767sm3837501wro.109.2023.10.04.05.01.15 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 04 Oct 2023 05:01:16 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, Markus Armbruster , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Alex?= =?utf-8?q?_Benn=C3=A9e?= , Paolo Bonzini Subject: [PATCH v3 09/16] semihosting: Clean up global variable shadowing Date: Wed, 4 Oct 2023 14:00:12 +0200 Message-ID: <20231004120019.93101-10-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 Received-SPF: pass client-ip=2a00:1450:4864:20::330; envelope-from=philmd@linaro.org; helo=mail-wm1-x330.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, SPF_PASS=-0.001 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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Fix: semihosting/config.c:134:49: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] int qemu_semihosting_config_options(const 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é Acked-by: Alex Bennée --- include/semihosting/semihost.h | 2 +- semihosting/config.c | 8 ++++---- stubs/semihost.c | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/semihosting/semihost.h b/include/semihosting/semihost.h index efd2efa25a..97d2a2ba99 100644 --- a/include/semihosting/semihost.h +++ b/include/semihosting/semihost.h @@ -66,7 +66,7 @@ const char *semihosting_get_cmdline(void); void semihosting_arg_fallback(const char *file, const char *cmd); /* for vl.c hooks */ void qemu_semihosting_enable(void); -int qemu_semihosting_config_options(const char *opt); +int qemu_semihosting_config_options(const char *optstr); void qemu_semihosting_chardev_init(void); void qemu_semihosting_console_init(Chardev *); #endif /* CONFIG_USER_ONLY */ diff --git a/semihosting/config.c b/semihosting/config.c index 8ca569735d..e826457733 100644 --- a/semihosting/config.c +++ b/semihosting/config.c @@ -131,10 +131,10 @@ void qemu_semihosting_enable(void) semihosting.target = SEMIHOSTING_TARGET_AUTO; } -int qemu_semihosting_config_options(const char *optarg) +int qemu_semihosting_config_options(const char *optstr) { QemuOptsList *opt_list = qemu_find_opts("semihosting-config"); - QemuOpts *opts = qemu_opts_parse_noisily(opt_list, optarg, false); + QemuOpts *opts = qemu_opts_parse_noisily(opt_list, optstr, false); semihosting.enabled = true; @@ -155,7 +155,7 @@ int qemu_semihosting_config_options(const char *optarg) semihosting.target = SEMIHOSTING_TARGET_AUTO; } else { error_report("unsupported semihosting-config %s", - optarg); + optstr); return 1; } } else { @@ -165,7 +165,7 @@ int qemu_semihosting_config_options(const char *optarg) qemu_opt_foreach(opts, add_semihosting_arg, &semihosting, NULL); } else { - error_report("unsupported semihosting-config %s", optarg); + error_report("unsupported semihosting-config %s", optstr); return 1; } diff --git a/stubs/semihost.c b/stubs/semihost.c index aad7a70353..b3c61935b3 100644 --- a/stubs/semihost.c +++ b/stubs/semihost.c @@ -36,7 +36,7 @@ void qemu_semihosting_enable(void) { } -int qemu_semihosting_config_options(const char *optarg) +int qemu_semihosting_config_options(const char *optstr) { return 1; }