From patchwork Tue Jan 18 16:22:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Martin_Li=C5=A1ka?= X-Patchwork-Id: 50167 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D85BB3857817 for ; Tue, 18 Jan 2022 16:23:13 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id BA49F3857C6A for ; Tue, 18 Jan 2022 16:22:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org BA49F3857C6A Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.cz Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id F0CF71F3BB for ; Tue, 18 Jan 2022 16:22:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1642522964; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/q2DPraKfopzRXwgSQ2Kk1wdpw3AKqQbdXXwkfRGL6w=; b=a/m99YJcXxiQq4kccmLK0xtAQ67dJV3sBn/PukjuihdRRZ8Xn7RYuV1fQ69uCJFIswpRZk Vh1Wgqd1x4gd9+oCcqbMlm9vVUQLohGykdD5OGbqj0CVlyVc0icLCJPwI00gDocm+AdgOM 5nePIpQ1rLY9CNn/bN7O8MgNl2wwd04= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1642522964; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/q2DPraKfopzRXwgSQ2Kk1wdpw3AKqQbdXXwkfRGL6w=; b=s63EQu1p8S81m5VM1wofgMGdJ8toyFW52plnfsGJG8ra4WTn4U5C/5JGmxbZFXCzWIv2C2 U8xsX1gyYzdA9fDQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id E384413DCD for ; Tue, 18 Jan 2022 16:22:44 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 0S9uNlTp5mH6fwAAMHmgww (envelope-from ) for ; Tue, 18 Jan 2022 16:22:44 +0000 Message-ID: <3f0a77b3-734b-8d37-29bd-5ba7e7b086a8@suse.cz> Date: Tue, 18 Jan 2022 17:22:44 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 From: =?utf-8?q?Martin_Li=C5=A1ka?= Subject: [PATCH] riscv: fix -Wformat-diag errors. To: gcc-patches@gcc.gnu.org Content-Language: en-US X-Spam-Status: No, score=-11.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" Pushed as pre-approved by Jeff. The patch fixes -Wformat-diag warnings. Martin gcc/ChangeLog: * common/config/riscv/riscv-common.cc (riscv_subset_list::add): Wrap keywords with quotes and remove trailing dots. (riscv_subset_list::parsing_subset_version): Likewise. (riscv_subset_list::parse_std_ext): Likewise. (riscv_subset_list::parse_multiletter_ext): Likewise. * config/riscv/riscv.cc (riscv_handle_type_attribute): Likewise. --- gcc/common/config/riscv/riscv-common.cc | 16 ++++++++-------- gcc/config/riscv/riscv.cc | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/gcc/common/config/riscv/riscv-common.cc b/gcc/common/config/riscv/riscv-common.cc index c1d8431c1fa..004822bfe6c 100644 --- a/gcc/common/config/riscv/riscv-common.cc +++ b/gcc/common/config/riscv/riscv-common.cc @@ -375,7 +375,7 @@ riscv_subset_list::add (const char *subset, int major_version, else error_at ( m_loc, - "%<-march=%s%>: Extension `%s' appear more than one time.", + "%<-march=%s%>: extension %qs appear more than one time", m_arch, subset); @@ -613,14 +613,14 @@ riscv_subset_list::parsing_subset_version (const char *ext, { if (!ISDIGIT (*(p+1))) { - error_at (m_loc, "%<-march=%s%>: Expect number " - "after %<%dp%>.", m_arch, version); + error_at (m_loc, "%<-march=%s%>: expect number " + "after %<%dp%>", m_arch, version); return NULL; } if (!major_p) { - error_at (m_loc, "%<-march=%s%>: For %<%s%dp%dp?%>, version " - "number with more than 2 level is not supported.", + error_at (m_loc, "%<-march=%s%>: for %<%s%dp%dp?%>, version " + "number with more than 2 level is not supported", m_arch, ext, major, version); return NULL; } @@ -701,8 +701,8 @@ riscv_subset_list::parse_std_ext (const char *p) /* std_ext_p= */ true, &explicit_version_p); if (major_version != 0 || minor_version != 0) { - warning_at (m_loc, 0, "version of `g` will be omitted, please " - "specify version for individual extension."); + warning_at (m_loc, 0, "version of % will be omitted, please " + "specify version for individual extension"); } /* We have special rule for G, we disallow rv32gm2p but allow rv32g_zicsr @@ -906,7 +906,7 @@ riscv_subset_list::parse_multiletter_ext (const char *p, if (*p != '\0' && *p != '_') { - error_at (m_loc, "%<-march=%s%>: %s must separate with _", + error_at (m_loc, "%<-march=%s%>: %s must separate with %<_%>", m_arch, ext_type_str); return NULL; } diff --git a/gcc/config/riscv/riscv.cc b/gcc/config/riscv/riscv.cc index 7c806780883..8314864d5e7 100644 --- a/gcc/config/riscv/riscv.cc +++ b/gcc/config/riscv/riscv.cc @@ -3309,8 +3309,8 @@ riscv_handle_type_attribute (tree *node ATTRIBUTE_UNUSED, tree name, tree args, && strcmp (string, "machine")) { warning (OPT_Wattributes, - "argument to %qE attribute is not \"user\", \"supervisor\", or \"machine\"", - name); + "argument to %qE attribute is not %, %, " + "or %", name); *no_add_attrs = true; } }