public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/users/marxin/heads/Wformat-diag-targets-part-2)] riscv: fix -Wformat-diag errors.
@ 2022-01-18 13:46 Martin Liska
0 siblings, 0 replies; 2+ messages in thread
From: Martin Liska @ 2022-01-18 13:46 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:2d5e85e52c8e8f4a96082610a06fd4d4b9a78131
commit 2d5e85e52c8e8f4a96082610a06fd4d4b9a78131
Author: Martin Liska <mliska@suse.cz>
Date: Tue Jan 18 14:07:01 2022 +0100
riscv: fix -Wformat-diag errors.
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.
Diff:
---
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 %<g%> 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 %<user%>, %<supervisor%>, "
+ "or %<machine%>", name);
*no_add_attrs = true;
}
}
^ permalink raw reply [flat|nested] 2+ messages in thread
* [gcc(refs/users/marxin/heads/Wformat-diag-targets-part-2)] riscv: fix -Wformat-diag errors.
@ 2022-01-18 13:32 Martin Liska
0 siblings, 0 replies; 2+ messages in thread
From: Martin Liska @ 2022-01-18 13:32 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:f67f8dde5614c850fb7b187a29c3576743cab81d
commit f67f8dde5614c850fb7b187a29c3576743cab81d
Author: Martin Liska <mliska@suse.cz>
Date: Tue Jan 18 14:07:01 2022 +0100
riscv: fix -Wformat-diag errors.
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.
Diff:
---
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 %<g%> 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 %<user%>, %<supervisor%>, "
+ "or %<machine%>", name);
*no_add_attrs = true;
}
}
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-01-18 13:46 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-18 13:46 [gcc(refs/users/marxin/heads/Wformat-diag-targets-part-2)] riscv: fix -Wformat-diag errors Martin Liska
-- strict thread matches above, loose matches on Subject: below --
2022-01-18 13:32 Martin Liska
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).