From patchwork Fri Oct 6 11:36:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Markus Armbruster X-Patchwork-Id: 729982 Delivered-To: patch@linaro.org Received: by 2002:a5d:4005:0:b0:31d:da82:a3b4 with SMTP id n5csp456262wrp; Fri, 6 Oct 2023 04:39:07 -0700 (PDT) X-Google-Smtp-Source: AGHT+IErbnUVluSVvpAQdPwW3kLrHiTJIhXO8R9glDH0fnBI/9+3rCNS+6gVnrNssJ4O1dqVXJuW X-Received: by 2002:ac8:5a4e:0:b0:405:464d:5bb0 with SMTP id o14-20020ac85a4e000000b00405464d5bb0mr8355161qta.32.1696592347667; Fri, 06 Oct 2023 04:39:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696592347; cv=none; d=google.com; s=arc-20160816; b=unNslffrkOo5KxCA87nzfCBvMpjhGI3mizTc0VahMN2mDXx059CqR6vn69bCkeR2PR Gi08oMHuNx0td9KHsBhaDHTGBArE/5WwCdyp0O5P6kF0pwAd7x+MufMub72g1WM5wboV qKj6pAFX+oBwsYKWAoe0RBCJZJ1mnECBxAm/5TLPeVXGgesshzX6T6GPDxtWy+z28AkT YNMUWpw7f3sly2U2GFMnJGyr4i0DMCa4THMxmgyL3NHXeZDOwr2gzfChn3q4E3w/XFfm yufAz/CQ4CbnM2QQhTBUij+vjwucJlFRO0+Lo556/rHGJ9t1X54ImqhOvFuExbxSBFvr eTjA== 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=E0/SmeVkKQwC85Yi9z735skKKvyYk8aaSrlBFMMKON8=; fh=cMN3UMXV46LDoC93McQlOI1ylKXTcR5CnghT4eHEg8Y=; b=tvxjW1p4wsc1pb4Rk7kEKoUpfiI0lAHyUVcS8cNSEmWrcStiOzu5YqXuY2qkVjo1zD OXGCJZec9jLg6g6m3YfI2qSK1aIRX46ZV735hw5yyovw4OOtRtyYwP7oti7nPpjqLFvf ZoN94i3VlHJmN7ew2taP+RGpV4UG/7yl/iHKWN/gfFb6M+IxcSmfpHktOHXRm/Rq84+F v1TWf2Y//tinbFuPZONcMs5nyoRsiOMFaXyXbu2AwH7D7dPwumdO+FjZiQtbTWE0aQ2N 61uLcSWrq0C+5EpysZQ0okOlyVxzGXu5qXV8fCNQhurH11+f5eW/tqSBOjPC6K/8mMXw aQeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=cGcp62DK; 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=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id m18-20020a05622a055200b004199dd36307si2236265qtx.484.2023.10.06.04.39.07 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 06 Oct 2023 04:39:07 -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=@redhat.com header.s=mimecast20190719 header.b=cGcp62DK; 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=redhat.com Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qoj9E-000557-4D; Fri, 06 Oct 2023 07:37:36 -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 1qoj8t-00050l-Lr for qemu-devel@nongnu.org; Fri, 06 Oct 2023 07:37:16 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qoj8n-00007B-UC for qemu-devel@nongnu.org; Fri, 06 Oct 2023 07:37:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696592222; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=E0/SmeVkKQwC85Yi9z735skKKvyYk8aaSrlBFMMKON8=; b=cGcp62DKW/hNGMXMM4WlkPkwL5d4ZErAW0KWOH1oFMnOXGBJvA2QRY/A7CppF9VR2BZeuh /Spttx/p8kPRNHyApM1ztcEghKHCTsVlEU6+uPcpeKN29CjIyPco6y0BIpuQ/73hVIMgyQ D7g5CXOhHQfD/IKsLEEkYFe0OqDselI= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-57-GUgSinHLNO6mKmG-zgCWcQ-1; Fri, 06 Oct 2023 07:37:01 -0400 X-MC-Unique: GUgSinHLNO6mKmG-zgCWcQ-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B8A191C06367; Fri, 6 Oct 2023 11:37:00 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 95DC440C6EA8; Fri, 6 Oct 2023 11:37:00 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 8934E21E6882; Fri, 6 Oct 2023 13:36:57 +0200 (CEST) From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Alex?= =?utf-8?q?_Benn=C3=A9e?= , Richard Henderson Subject: [PULL 18/32] semihosting: Clean up global variable shadowing Date: Fri, 6 Oct 2023 13:36:43 +0200 Message-ID: <20231006113657.3803180-19-armbru@redhat.com> In-Reply-To: <20231006113657.3803180-1-armbru@redhat.com> References: <20231006113657.3803180-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 Received-SPF: pass client-ip=170.10.129.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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-bounces+patch=linaro.org@nongnu.org From: Philippe Mathieu-Daudé 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é Message-ID: <20231004120019.93101-10-philmd@linaro.org> Reviewed-by: Alex Bennée Reviewed-by: Richard Henderson Signed-off-by: Markus Armbruster --- 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; }