public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
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 6/7] i386.c: make "sorry" message more amenable to translation (PR target/79926)
Date: Thu, 09 Mar 2017 17:16:00 -0000	[thread overview]
Message-ID: <1489081529-22256-7-git-send-email-dmalcolm@redhat.com> (raw)
In-Reply-To: <1489081529-22256-1-git-send-email-dmalcolm@redhat.com>

PR target/79926 notes that in:

    sorry ("%s instructions aren't allowed in %s service routine",
           isa, (cfun->machine->func_type == TYPE_EXCEPTION
                 ? "exception" : "interrupt"));

the text from the second %s won't be translated, but should be.

This patch reworks the diagnostic by breaking it out into two messages
and marking them with G_() so they're seen by xgettext; a test run of
xgettext confirms that both messages make it into po/gcc.pot (in an
earlier version of the patch I attempted to do it without introducing
a local, but xgettext only picked up on one of the strings).

gcc/ChangeLog:
	PR target/79926
	* config/i386/i386.c (ix86_set_current_function): Make "sorry"
	message more amenable to translation.
---
 gcc/config/i386/i386.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index e705a3e..b8688e3 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -7271,9 +7271,15 @@ ix86_set_current_function (tree fndecl)
       if (isa != NULL)
 	{
 	  if (cfun->machine->func_type != TYPE_NORMAL)
-	    sorry ("%s instructions aren't allowed in %s service routine",
-		   isa, (cfun->machine->func_type == TYPE_EXCEPTION
-			 ? "exception" : "interrupt"));
+	    {
+	      const char *msgid
+		= (cfun->machine->func_type == TYPE_EXCEPTION
+		   ? G_("%s instructions aren't allowed in"
+			" exception service routine")
+		   : G_("%s instructions aren't allowed in"
+			" interrupt service routine"));
+	      sorry (msgid, isa);
+	    }
 	  else
 	    sorry ("%s instructions aren't allowed in function with "
 		   "no_caller_saved_registers attribute", isa);
-- 
1.8.5.3

  parent reply	other threads:[~2017-03-09 17:16 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 ` [PATCH 7/7] Simplify uses of "%<%s%>" to "%qs" (PR translation/79848) David Malcolm
2017-03-10  6:36   ` 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 ` David Malcolm [this message]
2017-03-10  4:23   ` [PATCH 6/7] i386.c: make "sorry" message more amenable to translation (PR target/79926) 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-7-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).