aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2022-01-18 14:07:01 +0100
committerMartin Liska <mliska@suse.cz>2022-01-18 17:25:36 +0100
commit591b6e00d1bfe12932ca31530d5859f95db8a35a (patch)
treee1eb3f68d83e8e5ecc44cbc7879764d293a3813b /gcc
parent7ca1582ca60dc84cc3fc46b9cda620e2a0bed1bb (diff)
downloadgcc-591b6e00d1bfe12932ca31530d5859f95db8a35a.zip
gcc-591b6e00d1bfe12932ca31530d5859f95db8a35a.tar.gz
gcc-591b6e00d1bfe12932ca31530d5859f95db8a35a.tar.bz2
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.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/common/config/riscv/riscv-common.cc16
-rw-r--r--gcc/config/riscv/riscv.cc4
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 c1d8431..004822b 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 7c80678..8314864 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;
}
}