From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-x532.google.com (mail-ed1-x532.google.com [IPv6:2a00:1450:4864:20::532]) by sourceware.org (Postfix) with ESMTPS id 2E2C93857C58 for ; Tue, 18 Jan 2022 16:31:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2E2C93857C58 Received: by mail-ed1-x532.google.com with SMTP id 30so82071534edv.3 for ; Tue, 18 Jan 2022 08:31:18 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=GEfqgFl9hH2pItM3YjV7YikOThxvkxcDyuHCSaZxZho=; b=TXAYL7npuK2E5XNm4h8JbzG1IYv+12dmneZxHpTk+S0pW+idKLWgTGylcXNCPHY9z5 jp6nHZfrsdI4liVeiAxaFfWRxFhlRusrZSTSVzx4Odp3pHjBcVQZg4Zqz1U53OOiaDes QtJ2nR3rXiPKuxfSzbWKUndhXxAMSmGQb+VPmD9f+15FCTc2mNkAtnqsmXcDjsQUn7wj xgXOhSW9aY93u06mxQzRRACceHYa2yt4avuxKvjZoGUDAq/FOl3D7WOw4MuNSUcSS5O9 EMTdihYKaBLz4aPH42X5dO64axId/gL0dQQZ3UJnA08m7/rmEKJNkl7H/dvtkWjVkE7O sxmw== X-Gm-Message-State: AOAM531lT+IhYgqP+IV8QFxWHEAFyt2UDg8rnq1ZrvBMUprOjCDN8nQC i+BT2acNTcm3MZIMItfO6j0PD25uoXnzWepEgB8= X-Google-Smtp-Source: ABdhPJy+Zkr4UsExBedhAWo+UlWAd3/3698v+KX+WqWl23aWtYc2qpaQkSFrDFK9mUqauHCrLYBii1ZrgWMK5sDvOSE= X-Received: by 2002:a17:906:a42:: with SMTP id x2mr22639845ejf.125.1642523476856; Tue, 18 Jan 2022 08:31:16 -0800 (PST) MIME-Version: 1.0 References: <3f0a77b3-734b-8d37-29bd-5ba7e7b086a8@suse.cz> In-Reply-To: <3f0a77b3-734b-8d37-29bd-5ba7e7b086a8@suse.cz> From: Kito Cheng Date: Wed, 19 Jan 2022 00:31:12 +0800 Message-ID: Subject: Re: [PATCH] riscv: fix -Wformat-diag errors. To: =?UTF-8?Q?Martin_Li=C5=A1ka?= Cc: GCC Patches Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-8.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, 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: , X-List-Received-Date: Tue, 18 Jan 2022 16:31:19 -0000 Thanks Martin! On Wed, Jan 19, 2022 at 12:23 AM Martin Li=C5=A1ka wrote: > > 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=3D%s%>: Extension `%s' appear more than one time.", > + "%<-march=3D%s%>: extension %qs appear more than one time", > m_arch, > subset); > > @@ -613,14 +613,14 @@ riscv_subset_list::parsing_subset_version (const ch= ar *ext, > { > if (!ISDIGIT (*(p+1))) > { > - error_at (m_loc, "%<-march=3D%s%>: Expect number " > - "after %<%dp%>.", m_arch, version); > + error_at (m_loc, "%<-march=3D%s%>: expect number " > + "after %<%dp%>", m_arch, version); > return NULL; > } > if (!major_p) > { > - error_at (m_loc, "%<-march=3D%s%>: For %<%s%dp%dp?%>, ver= sion " > - "number with more than 2 level is not supported= .", > + error_at (m_loc, "%<-march=3D%s%>: for %<%s%dp%dp?%>, ver= sion " > + "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=3D */ true, &explicit_vers= ion_p); > if (major_version !=3D 0 || minor_version !=3D 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 rv3= 2g_zicsr > @@ -906,7 +906,7 @@ riscv_subset_list::parse_multiletter_ext (const char = *p, > > if (*p !=3D '\0' && *p !=3D '_') > { > - error_at (m_loc, "%<-march=3D%s%>: %s must separate with _", > + error_at (m_loc, "%<-march=3D%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_U= NUSED, tree name, tree args, > && strcmp (string, "machine")) > { > warning (OPT_Wattributes, > - "argument to %qE attribute is not \"user\", \"supe= rvisor\", or \"machine\"", > - name); > + "argument to %qE attribute is not %, %, " > + "or %", name); > *no_add_attrs =3D true; > } > } > -- > 2.34.1 > >