From: David Malcolm <dmalcolm@redhat.com>
To: gcc-patches@gcc.gnu.org
Cc: roland.illig@gmx.de, Joseph Myers <joseph@codesourcery.com>,
David Malcolm <dmalcolm@redhat.com>
Subject: [PATCH 7/7] Simplify uses of "%<%s%>" to "%qs" (PR translation/79848)
Date: Thu, 09 Mar 2017 17:15:00 -0000 [thread overview]
Message-ID: <1489081529-22256-8-git-send-email-dmalcolm@redhat.com> (raw)
In-Reply-To: <1489081529-22256-1-git-send-email-dmalcolm@redhat.com>
PR translation/79848 requests that uses of "%<%s%>" in diagnostic messages
be simplified to "%qs", presumably to make it easier for translators
to deal with them.
This patch does this for all such strings found in the source tree.
gcc/c-family/ChangeLog:
PR translation/79848
* c-format.c (check_format_string): Simplify uses of "%<%s%>" to
"%qs".
gcc/c/ChangeLog:
PR translation/79848
* c-decl.c (declspecs_add_type): Simplify uses of "%<%s%>" to
"%qs".
* c-parser.c (c_parser_oacc_shape_clause): Likewise.
gcc/cp/ChangeLog:
PR translation/79848
* decl.c (grokfndecl): Simplify uses of "%<%s%>" to "%qs".
gcc/ChangeLog:
PR translation/79848
* ipa-devirt.c (warn_types_mismatch): Simplify uses of "%<%s%>" to
"%qs".
* ipa-pure-const.c (suggest_attribute): Likewise.
---
gcc/c-family/c-format.c | 6 +++---
gcc/c/c-decl.c | 16 ++++++++--------
gcc/c/c-parser.c | 2 +-
gcc/cp/decl.c | 6 +++---
gcc/ipa-devirt.c | 2 +-
gcc/ipa-pure-const.c | 4 ++--
6 files changed, 18 insertions(+), 18 deletions(-)
diff --git a/gcc/c-family/c-format.c b/gcc/c-family/c-format.c
index 81be935..400eb66 100644
--- a/gcc/c-family/c-format.c
+++ b/gcc/c-family/c-format.c
@@ -207,7 +207,7 @@ check_format_string (tree fntype, unsigned HOST_WIDE_INT format_num,
{
/* We expected a char but found an extended string type. */
if (is_objc_sref)
- error ("found a %<%s%> reference but the format argument should"
+ error ("found a %qs reference but the format argument should"
" be a string", format_name (gcc_objc_string_format_type));
else
error ("found a %qT but the format argument should be a string",
@@ -220,7 +220,7 @@ check_format_string (tree fntype, unsigned HOST_WIDE_INT format_num,
/* We expect a string object type as the format arg. */
if (is_char_ref)
{
- error ("format argument should be a %<%s%> reference but"
+ error ("format argument should be a %qs reference but"
" a string was found", format_name (expected_format_type));
*no_add_attrs = true;
return false;
@@ -242,7 +242,7 @@ check_format_string (tree fntype, unsigned HOST_WIDE_INT format_num,
return true;
else
{
- error ("format argument should be a %<%s%> reference",
+ error ("format argument should be a %qs reference",
format_name (expected_format_type));
*no_add_attrs = true;
return false;
diff --git a/gcc/c/c-decl.c b/gcc/c/c-decl.c
index 645304a..dd66cb6 100644
--- a/gcc/c/c-decl.c
+++ b/gcc/c/c-decl.c
@@ -10513,37 +10513,37 @@ declspecs_add_type (location_t loc, struct c_declspecs *specs,
str = "_Decimal128";
if (specs->long_long_p)
error_at (loc,
- ("both %<long long%> and %<%s%> in "
+ ("both %<long long%> and %qs in "
"declaration specifiers"),
str);
if (specs->long_p)
error_at (loc,
- ("both %<long%> and %<%s%> in "
+ ("both %<long%> and %qs in "
"declaration specifiers"),
str);
else if (specs->short_p)
error_at (loc,
- ("both %<short%> and %<%s%> in "
+ ("both %<short%> and %qs in "
"declaration specifiers"),
str);
else if (specs->signed_p)
error_at (loc,
- ("both %<signed%> and %<%s%> in "
+ ("both %<signed%> and %qs in "
"declaration specifiers"),
str);
else if (specs->unsigned_p)
error_at (loc,
- ("both %<unsigned%> and %<%s%> in "
+ ("both %<unsigned%> and %qs in "
"declaration specifiers"),
str);
else if (specs->complex_p)
error_at (loc,
- ("both %<complex%> and %<%s%> in "
+ ("both %<complex%> and %qs in "
"declaration specifiers"),
str);
else if (specs->saturating_p)
error_at (loc,
- ("both %<_Sat%> and %<%s%> in "
+ ("both %<_Sat%> and %qs in "
"declaration specifiers"),
str);
else if (i == RID_DFLOAT32)
@@ -10571,7 +10571,7 @@ declspecs_add_type (location_t loc, struct c_declspecs *specs,
str = "_Accum";
if (specs->complex_p)
error_at (loc,
- ("both %<complex%> and %<%s%> in "
+ ("both %<complex%> and %qs in "
"declaration specifiers"),
str);
else if (i == RID_FRACT)
diff --git a/gcc/c/c-parser.c b/gcc/c/c-parser.c
index fa4e950..2a37ea8 100644
--- a/gcc/c/c-parser.c
+++ b/gcc/c/c-parser.c
@@ -11816,7 +11816,7 @@ c_parser_oacc_shape_clause (c_parser *parser, omp_clause_code kind,
if (c == boolean_true_node)
{
warning_at (loc, 0,
- "%<%s%> value must be positive", str);
+ "%qs value must be positive", str);
expr = integer_one_node;
}
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 3e7316f..a8d45bd 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -8777,13 +8777,13 @@ grokfndecl (tree ctype,
if (long_long_unsigned_p)
{
if (cpp_interpret_int_suffix (parse_in, suffix, strlen (suffix)))
- warning (0, "integer suffix %<%s%>"
+ warning (0, "integer suffix %qs"
" shadowed by implementation", suffix);
}
else if (long_double_p)
{
if (cpp_interpret_float_suffix (parse_in, suffix, strlen (suffix)))
- warning (0, "floating point suffix %<%s%>"
+ warning (0, "floating point suffix %qs"
" shadowed by implementation", suffix);
}
}
@@ -11838,7 +11838,7 @@ grokdeclarator (const cp_declarator *declarator,
headers because glibc uses them. */;
else if (name)
pedwarn (input_location, OPT_Wpedantic,
- "ISO C++ forbids flexible array member %<%s%>", name);
+ "ISO C++ forbids flexible array member %qs", name);
else
pedwarn (input_location, OPT_Wpedantic,
"ISO C++ forbids flexible array members");
diff --git a/gcc/ipa-devirt.c b/gcc/ipa-devirt.c
index 0e5eb85..0c74c87 100644
--- a/gcc/ipa-devirt.c
+++ b/gcc/ipa-devirt.c
@@ -1139,7 +1139,7 @@ warn_types_mismatch (tree t1, tree t2, location_t loc1, location_t loc2)
if (name1 && name2 && strcmp (name1, name2))
{
inform (loc_t1,
- "type name %<%s%> should match type name %<%s%>",
+ "type name %qs should match type name %qs",
name1, name2);
if (loc_t2_useful)
inform (loc_t2,
diff --git a/gcc/ipa-pure-const.c b/gcc/ipa-pure-const.c
index 5cc2002..2ceb86f 100644
--- a/gcc/ipa-pure-const.c
+++ b/gcc/ipa-pure-const.c
@@ -184,8 +184,8 @@ suggest_attribute (int option, tree decl, bool known_finite,
warning_at (DECL_SOURCE_LOCATION (decl),
option,
known_finite
- ? _("function might be candidate for attribute %<%s%>")
- : _("function might be candidate for attribute %<%s%>"
+ ? _("function might be candidate for attribute %qs")
+ : _("function might be candidate for attribute %qs"
" if it is known to return normally"), attrib_name);
return warned_about;
}
--
1.8.5.3
next prev parent reply other threads:[~2017-03-09 17:15 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-09 17:15 [PATCH 0/7] Various i18n fixes (and questions) David Malcolm
2017-03-09 17:15 ` David Malcolm [this message]
2017-03-10 6:36 ` [PATCH 7/7] Simplify uses of "%<%s%>" to "%qs" (PR translation/79848) Jakub Jelinek
2017-03-09 17:16 ` [PATCH 5/7] fortran: remove trailing exclamation mark from various diagnostics (PR fortran/79852) David Malcolm
2017-03-09 17:16 ` [PATCH 2/7] aarch64.c: tweaks to quoting in error messages (PR target/79925) David Malcolm
2017-03-11 0:39 ` Joseph Myers
2017-03-09 17:16 ` [PATCH 4/7] c-indentation.c: workaround xgettext limitation (PR c/79921) David Malcolm
2017-03-10 6:26 ` Jakub Jelinek
2017-03-09 17:16 ` [PATCH 1/7] Add missing punctuation to message (PR driver/79875) David Malcolm
2017-03-10 4:15 ` Martin Sebor
2017-03-10 19:46 ` David Malcolm
2017-03-11 10:29 ` Roland Illig
2017-03-14 9:58 ` Bernhard Reutner-Fischer
2017-03-10 6:18 ` Jakub Jelinek
2017-03-09 17:16 ` [PATCH 3/7] Remove trailing period from various diagnostic messages (PR translation/79923) David Malcolm
2017-03-10 6:24 ` Jakub Jelinek
2017-03-10 9:24 ` Kyrill Tkachov
2017-03-10 9:31 ` Jakub Jelinek
2017-03-10 9:32 ` Kyrill Tkachov
2017-03-10 23:36 ` David Malcolm
2017-03-13 9:01 ` Kyrill Tkachov
2017-03-09 17:16 ` [PATCH 6/7] i386.c: make "sorry" message more amenable to translation (PR target/79926) David Malcolm
2017-03-10 4:23 ` Martin Sebor
2017-03-10 6:33 ` Jakub Jelinek
2017-03-11 1:52 ` [PATCH 6/7 v2] " David Malcolm
2019-03-08 17:30 ` Jakub Jelinek
2017-03-09 21:36 ` [PATCH 0/7] Various i18n fixes (and questions) Gerald Pfeifer
2017-03-11 0:38 ` Joseph Myers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1489081529-22256-8-git-send-email-dmalcolm@redhat.com \
--to=dmalcolm@redhat.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=joseph@codesourcery.com \
--cc=roland.illig@gmx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).