This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] gettext support for GCC 4.0 internal format, fix for PR translation/21364


On Mon, May 30, 2005 at 06:54:31PM +0200, Bruno Haible wrote:
> Jakub Jelinek wrote:
> > Ok, I wrote the necessary gettext support for the newly intoduced format
> > string stuff
> 
> Thanks a lot. I have put out a new gettext-0.14.5 release that contains
> support for GCC-4.0 format strings. (Based on your patch, plus additional
> checking of %m directives, plus testsuite updates.)

Thanks.

>   3) The GCC i18n maintainer ensures that gettext >= 0.14.5 is used for
>      constructing the gcc.pot file.
>   4) The GCC i18n maintainer regenerates the gcc.pot file (it should
>      contain many "#, gcc-internal-format" annotations this time), and
>      submits it to the TP.
>   5) The GCC i18n maintainer does an 'msgmerge' of this new gcc.pot file
>      with the original .po files, using gettext >= 0.14.5. This will
>      automatically mark those messages as fuzzy that are not valid, matching
>      format strings. This step obsoletes Jakub's gcc41-po-fixes.patch.
>   6) The GCC i18n maintainer receives through the TP the updated translations
>      from the translators.
> 
> Steps 1 and 2 have already been done. You can go ahead with step 3 to 6.

I tried to do step 3, but failed.
The patch below is the failed attempt.
Instead of the former simple msgid markings the following patch adds also
gmsgid and cmsgid.  gmsgid means a msgid in gcc-internal-format
(i.e. where is GCC uses __attribute__ ((__format__ (__gcc_diag__, m, n)))),
cmsgid means a msgid in c-format (__attribute__ ((__format__ (__printf__, m, n))))
and msgid elsewhere.
But I'm unable to convince xgettext 0.14.5 to generate c-format
for cmsgid marked arguments and gcc-internal-format for gmsgid marked ones.

Let's talk about minimal testcase, test.c:
void foo (tree decl)
{
  const char *msg;
  error ("abc %qE", decl);
  warning (0, "abc");
  fnotice (stderr, "%g\n", 7.15);
  printf ("%s\n", _("Hello"));
}

Here, I want all first arguments of error and all second arguments of
warning to be treated as gcc-internal-format, all second arguments of
fnotice as c-format and first arguments of _ as no format at all (or
automatic format).

xgettext test.c --language=GCC-source --keyword=error --keyword=warning:2 \
--keyword=fnotice:2 --keyword=_ --flag=error:1:gcc-internal-format \
--flag=warning:2:gcc-internal-format --flag=fnotice:2:c-format

doesn't do this, it will mark error and warning string literals
as gcc-internal-format, but not mark "%g\n" as c-format.

xgettext test.c --language=c --keyword=error --keyword=warning:2 \
--keyword=fnotice:2 --keyword=_ --flag=error:1:gcc-internal-format \
--flag=warning:2:gcc-internal-format --flag=fnotice:2:c-format

doesn't do the right thing either, marks "abc %qE" and "%g\n"
as c-format, the rest not marked.

Is there any way how to make all these working together,
or do I need to run multiple invocations of xgettext
(once with --language=GCC-source, once with --language=c
and each time with the right set of --keyword options,
then merge the result manually)?  Will other tools handle
mixed message types?

--- gcc/po/exgettext.jj	2005-05-18 14:28:21.000000000 +0200
+++ gcc/po/exgettext	2005-05-31 15:34:09.000000000 +0200
@@ -95,12 +95,25 @@ function keyword_option(line) {
     for (n = 1; sub(/^[^,]*,/, "", args); n++) {
 	continue
     }
+    format=""
+    if (args ~ /g$/)
+    	format="gcc-internal-format"
+    else if (args ~ /c$/)
+    	format="c-format"
+
+    if (n == 1) { keyword = "--keyword=" name }
+    else { keyword = "--keyword=" name ":" n }
+    if (format) {
+        keyword=keyword "\n--flag=" name ":" n ":" format
+    }
 
-    if (n == 1) { keyword = name }
-    else        { keyword = name ":" n }
-
-    if (! keyword_seen[keyword]++) {
-	print "--keyword=" keyword > kopt
+    if (! keyword_seen[name]) {
+    	print keyword > kopt
+    	keyword_seen[name] = keyword
+    } else if (keyword_seen[name] != keyword) {
+	printf("%s used incompatibly as both %s and %s\n",
+	       name, keyword_seen[name], keyword)
+	exit (1)
     }
 }
 
@@ -155,7 +168,7 @@ END {
     }
     print emsg > posr
 }'
-)
+) || exit
 
 echo "scanning option files..." >&2
 
--- gcc/rtl-error.c.jj	2004-10-16 09:01:56.000000000 +0200
+++ gcc/rtl-error.c	2005-05-31 14:30:31.000000000 +0200
@@ -87,22 +87,22 @@ diagnostic_for_asm (rtx insn, const char
 }
 
 void
-error_for_asm (rtx insn, const char *msgid, ...)
+error_for_asm (rtx insn, const char *gmsgid, ...)
 {
   va_list ap;
 
   va_start (ap, msgid);
-  diagnostic_for_asm (insn, msgid, &ap, DK_ERROR);
+  diagnostic_for_asm (insn, gmsgid, &ap, DK_ERROR);
   va_end (ap);
 }
 
 void
-warning_for_asm (rtx insn, const char *msgid, ...)
+warning_for_asm (rtx insn, const char *gmsgid, ...)
 {
   va_list ap;
 
   va_start (ap, msgid);
-  diagnostic_for_asm (insn, msgid, &ap, DK_WARNING);
+  diagnostic_for_asm (insn, gmsgid, &ap, DK_WARNING);
   va_end (ap);
 }
 
--- gcc/tree-ssa.c.jj	2005-05-25 17:15:42.000000000 +0200
+++ gcc/tree-ssa.c	2005-05-31 14:47:22.000000000 +0200
@@ -1079,7 +1079,7 @@ walk_use_def_chains (tree var, walk_use_
    warning text is in MSGID and LOCUS may contain a location or be null.  */
 
 static void
-warn_uninit (tree t, const char *msgid, void *data)
+warn_uninit (tree t, const char *gmsgid, void *data)
 {
   tree var = SSA_NAME_VAR (t);
   tree def = SSA_NAME_DEF_STMT (t);
@@ -1107,7 +1107,7 @@ warn_uninit (tree t, const char *msgid, 
   locus = (context != NULL && EXPR_HAS_LOCATION (context)
 	   ? EXPR_LOCUS (context)
 	   : &DECL_SOURCE_LOCATION (var));
-  warning (0, msgid, locus, var);
+  warning (0, gmsgid, locus, var);
   TREE_NO_WARNING (var) = 1;
 }
    
--- gcc/c-parser.c.jj	2005-05-16 09:44:20.000000000 +0200
+++ gcc/c-parser.c	2005-05-31 14:28:11.000000000 +0200
@@ -635,18 +635,18 @@ c_parser_new (void)
    used.  */
 
 static void
-c_parser_error (c_parser *parser, const char *msgid)
+c_parser_error (c_parser *parser, const char g*msgid)
 {
   c_token *token = c_parser_peek_token (parser);
   if (parser->error)
     return;
   parser->error = true;
-  if (!msgid)
+  if (!gmsgid)
     return;
   /* This diagnostic makes more sense if it is tagged to the line of
      the token we just peeked at.  */
   c_parser_set_source_position_from_token (token);
-  c_parse_error (msgid,
+  c_parse_error (gmsgid,
 		 /* Because c_parse_error does not understand
 		    CPP_KEYWORD, keywords are treated like
 		    identifiers.  */
--- gcc/gcc.c.jj	2005-05-16 09:44:25.000000000 +0200
+++ gcc/gcc.c	2005-05-31 14:58:56.000000000 +0200
@@ -6716,40 +6716,46 @@ fancy_abort (const char *file, int line,
 /* Output an error message and exit.  */
 
 void
-fatal (const char *msgid, ...)
+fatal (const char *cmsgid, ...)
 {
   va_list ap;
 
-  va_start (ap, msgid);
+  va_start (ap, cmsgid);
 
   fprintf (stderr, "%s: ", programname);
-  vfprintf (stderr, _(msgid), ap);
+  vfprintf (stderr, _(cmsgid), ap);
   va_end (ap);
   fprintf (stderr, "\n");
   delete_temp_files ();
   exit (1);
 }
 
+/* The argument is actually c-format, not gcc-internal-format,
+   but because functions with identical names are used through
+   the rest of the compiler with gcc-internal-format, we just
+   need to hope all users of these functions use the common
+   subset between c-format and gcc-internal-format.  */
+
 void
-error (const char *msgid, ...)
+error (const char *gmsgid, ...)
 {
   va_list ap;
 
-  va_start (ap, msgid);
+  va_start (ap, gmsgid);
   fprintf (stderr, "%s: ", programname);
-  vfprintf (stderr, _(msgid), ap);
+  vfprintf (stderr, _(gmsgid), ap);
   va_end (ap);
 
   fprintf (stderr, "\n");
 }
 
 static void
-notice (const char *msgid, ...)
+notice (const char *cmsgid, ...)
 {
   va_list ap;
 
-  va_start (ap, msgid);
-  vfprintf (stderr, _(msgid), ap);
+  va_start (ap, cmsgid);
+  vfprintf (stderr, _(cmsgid), ap);
   va_end (ap);
 }
 
--- gcc/config/rs6000/rs6000-c.c.jj	2005-05-06 09:58:38.000000000 +0200
+++ gcc/config/rs6000/rs6000-c.c	2005-05-31 14:33:09.000000000 +0200
@@ -50,8 +50,8 @@ static tree altivec_resolve_overloaded_b
    whether or not new function declarations receive a longcall
    attribute by default.  */
 
-#define SYNTAX_ERROR(msgid) do {			\
-  warning (0, msgid);					\
+#define SYNTAX_ERROR(gmsgid) do {			\
+  warning (0, gmsgid);					\
   warning (0, "ignoring malformed #pragma longcall");	\
   return;						\
 } while (0)
--- gcc/config/darwin-c.c.jj	2005-04-29 09:18:11.000000000 +0200
+++ gcc/config/darwin-c.c	2005-05-31 14:36:05.000000000 +0200
@@ -35,7 +35,7 @@ Boston, MA 02111-1307, USA.  */
 
 /* Pragmas.  */
 
-#define BAD(msgid) do { warning (0, msgid); return; } while (0)
+#define BAD(gmsgid) do { warning (0, gmsgid); return; } while (0)
 
 static bool using_frameworks = false;
 
--- gcc/config/c4x/c4x-c.c.jj	2005-04-25 11:56:20.000000000 +0200
+++ gcc/config/c4x/c4x-c.c	2005-05-31 14:35:47.000000000 +0200
@@ -57,7 +57,7 @@ static int c4x_parse_pragma (const char 
    the STRING_CST node of the string.  If SECT is null, then this
    pragma doesn't take a section string.  Returns 0 for a good pragma,
    -1 for a malformed pragma.  */
-#define BAD(msgid, arg) do { warning (0, msgid, arg); return -1; } while (0)
+#define BAD(gmsgid, arg) do { warning (0, gmsgid, arg); return -1; } while (0)
 
 static int
 c4x_parse_pragma (name, func, sect)
--- gcc/cp/error.c.jj	2005-05-25 11:52:16.000000000 +0200
+++ gcc/cp/error.c	2005-05-31 14:41:28.000000000 +0200
@@ -2326,13 +2326,13 @@ cp_printer (pretty_printer *pp, text_inf
    behavior of cp_*_at.  */
 
 static tree
-locate_error (const char *msgid, va_list ap)
+locate_error (const char *gmsgid, va_list ap)
 {
   tree here = 0, t;
   int plus = 0;
   const char *f;
 
-  for (f = msgid; *f; f++)
+  for (f = gmsgid; *f; f++)
     {
       plus = 0;
       if (*f == '%')
@@ -2388,57 +2388,57 @@ locate_error (const char *msgid, va_list
 
 
 void
-cp_error_at (const char *msgid, ...)
+cp_error_at (const char *gmsgid, ...)
 {
   tree here;
   diagnostic_info diagnostic;
   va_list ap;
 
-  va_start (ap, msgid);
-  here = locate_error (msgid, ap);
+  va_start (ap, gmsgid);
+  here = locate_error (gmsgid, ap);
   va_end (ap);
 
-  va_start (ap, msgid);
-  diagnostic_set_info (&diagnostic, msgid, &ap,
+  va_start (ap, gmsgid);
+  diagnostic_set_info (&diagnostic, gmsgid, &ap,
                        input_location, DK_ERROR);
   cp_diagnostic_starter (global_dc, &diagnostic);
-  diagnostic_set_info (&diagnostic, msgid, &ap,
+  diagnostic_set_info (&diagnostic, gmsgid, &ap,
                        location_of (here), DK_ERROR);
   report_diagnostic (&diagnostic);
   va_end (ap);
 }
 
 void
-cp_warning_at (const char *msgid, ...)
+cp_warning_at (const char *gmsgid, ...)
 {
   tree here;
   diagnostic_info diagnostic;
   va_list ap;
 
-  va_start (ap, msgid);
-  here = locate_error (msgid, ap);
+  va_start (ap, gmsgid);
+  here = locate_error (gmsgid, ap);
   va_end (ap);
 
-  va_start (ap, msgid);
-  diagnostic_set_info (&diagnostic, msgid, &ap,
+  va_start (ap, gmsgid);
+  diagnostic_set_info (&diagnostic, gmsgid, &ap,
                        location_of (here), DK_WARNING);
   report_diagnostic (&diagnostic);
   va_end (ap);
 }
 
 void
-cp_pedwarn_at (const char *msgid, ...)
+cp_pedwarn_at (const char *gmsgid, ...)
 {
   tree here;
   diagnostic_info diagnostic;
   va_list ap;
 
-  va_start (ap, msgid);
-  here = locate_error (msgid, ap);
+  va_start (ap, gmsgid);
+  here = locate_error (gmsgid, ap);
   va_end (ap);
 
-  va_start (ap, msgid);
-  diagnostic_set_info (&diagnostic, msgid, &ap,
+  va_start (ap, gmsgid);
+  diagnostic_set_info (&diagnostic, gmsgid, &ap,
                        location_of (here), pedantic_error_kind());
   report_diagnostic (&diagnostic);
   va_end (ap);
--- gcc/java/jv-scan.c.jj	2005-04-29 09:18:37.000000000 +0200
+++ gcc/java/jv-scan.c	2005-05-31 15:15:33.000000000 +0200
@@ -40,10 +40,10 @@ Boston, MA 02111-1307, USA.  */
 
 #include <getopt.h>
 
-extern void fatal_error (const char *msgid, ...)
+extern void fatal_error (const char *gmsgid, ...)
      ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN;
-void warning (int opt, const char *msgid, ...) ATTRIBUTE_PRINTF_2;
-void warning0 (const char *msgid, ...) ATTRIBUTE_PRINTF_1;
+void warning (int opt, const char *gmsgid, ...) ATTRIBUTE_PRINTF_2;
+void warning0 (const char *gmsgid, ...) ATTRIBUTE_PRINTF_1;
 void report (void);
 
 static void usage (void) ATTRIBUTE_NORETURN;
@@ -245,38 +245,40 @@ main (int argc, char **argv)
 
 
 /* Error report, memory, obstack initialization and other utility
-   functions */
+   functions.  Use actually c-format msgid, but as functions with
+   the same name elsewhere use gcc-internal-format, assume all users
+   here use intersection between c-format and gcc-internal-format.  */
 
 void
-fatal_error (const char *msgid, ...)
+fatal_error (const char *gmsgid, ...)
 {
   va_list ap;
-  va_start (ap, msgid);
+  va_start (ap, gmsgid);
   fprintf (stderr, _("%s: error: "), exec_name);
-  vfprintf (stderr, _(msgid), ap);
+  vfprintf (stderr, _(gmsgid), ap);
   fputc ('\n', stderr);
   va_end (ap);
   exit (1);
 }
 
 void
-warning (int opt ATTRIBUTE_UNUSED, const char *msgid, ...)
+warning (int opt ATTRIBUTE_UNUSED, const char *gmsgid, ...)
 {
   va_list ap;
-  va_start (ap, msgid);
+  va_start (ap, gmsgid);
   fprintf (stderr, _("%s: warning: "), exec_name);
-  vfprintf (stderr, _(msgid), ap);
+  vfprintf (stderr, _(gmsgid), ap);
   fputc ('\n', stderr);
   va_end (ap);
 }
 
 void
-warning0 (const char *msgid, ...)
+warning0 (const char *gmsgid, ...)
 {
   va_list ap;
-  va_start (ap, msgid);
+  va_start (ap, gmsgid);
   fprintf (stderr, _("%s: warning: "), exec_name);
-  vfprintf (stderr, _(msgid), ap);
+  vfprintf (stderr, _(gmsgid), ap);
   fputc ('\n', stderr);
   va_end (ap);
 }
--- gcc/java/gjavah.c.jj	2005-05-06 09:58:46.000000000 +0200
+++ gcc/java/gjavah.c	2005-05-31 15:16:33.000000000 +0200
@@ -164,7 +164,7 @@ static const unsigned char *
   decode_signature_piece (FILE *, const unsigned char *,
 			  const unsigned char *, int *);
 static void print_class_decls (FILE *, JCF *, int);
-static void error (const char *msgid, ...);
+static void error (const char *gmsgid, ...);
 static void usage (void) ATTRIBUTE_NORETURN;
 static void help (void) ATTRIBUTE_NORETURN;
 static void version (void) ATTRIBUTE_NORETURN;
@@ -266,16 +266,19 @@ static int decompiled = 0;
 
 #include "jcf-reader.c"
 
-/* Print an error message and set found_error.  */
+/* Print an error message and set found_error.
+   Not really gcc-internal-format message, but as error elsewhere
+   uses it, assume all users will use intersection between
+   c-format and gcc-internal-format.  */
 static void
-error (const char *msgid, ...)
+error (const char *gmsgid, ...)
 {
   va_list ap;
 
-  va_start (ap, msgid);
+  va_start (ap, gmsgid);
 
   fprintf (stderr, TOOLNAME ": ");
-  vfprintf (stderr, _(msgid), ap);
+  vfprintf (stderr, _(gmsgid), ap);
   va_end (ap);
   fprintf (stderr, "\n");
   found_error = 1;
--- gcc/c-pragma.c.jj	2005-04-29 09:17:42.000000000 +0200
+++ gcc/c-pragma.c	2005-05-31 14:27:31.000000000 +0200
@@ -36,8 +36,9 @@ Software Foundation, 59 Temple Place - S
 #include "tm_p.h"
 #include "target.h"
 
-#define GCC_BAD(msgid) do { warning (0, msgid); return; } while (0)
-#define GCC_BAD2(msgid, arg) do { warning (0, msgid, arg); return; } while (0)
+#define GCC_BAD(gmsgid) do { warning (0, gmsgid); return; } while (0)
+#define GCC_BAD2(gmsgid, arg) \
+  do { warning (0, gmsgid, arg); return; } while (0)
 
 typedef struct align_stack GTY(())
 {
--- gcc/collect2.c.jj	2005-04-29 09:17:46.000000000 +0200
+++ gcc/collect2.c	2005-05-31 15:00:09.000000000 +0200
@@ -328,26 +328,26 @@ collect_exit (int status)
 
 /* Notify user of a non-error.  */
 void
-notice (const char *msgid, ...)
+notice (const char *cmsgid, ...)
 {
   va_list ap;
 
-  va_start (ap, msgid);
-  vfprintf (stderr, _(msgid), ap);
+  va_start (ap, cmsgid);
+  vfprintf (stderr, _(cmsgid), ap);
   va_end (ap);
 }
 
 /* Die when sys call fails.  */
 
 void
-fatal_perror (const char * msgid, ...)
+fatal_perror (const char * cmsgid, ...)
 {
   int e = errno;
   va_list ap;
 
-  va_start (ap, msgid);
+  va_start (ap, cmsgid);
   fprintf (stderr, "collect2: ");
-  vfprintf (stderr, _(msgid), ap);
+  vfprintf (stderr, _(cmsgid), ap);
   fprintf (stderr, ": %s\n", xstrerror (e));
   va_end (ap);
 
@@ -357,13 +357,13 @@ fatal_perror (const char * msgid, ...)
 /* Just die.  */
 
 void
-fatal (const char * msgid, ...)
+fatal (const char * cmsgid, ...)
 {
   va_list ap;
 
-  va_start (ap, msgid);
+  va_start (ap, cmsgid);
   fprintf (stderr, "collect2: ");
-  vfprintf (stderr, _(msgid), ap);
+  vfprintf (stderr, _(cmsgid), ap);
   fprintf (stderr, "\n");
   va_end (ap);
 
@@ -373,13 +373,13 @@ fatal (const char * msgid, ...)
 /* Write error message.  */
 
 void
-error (const char * msgid, ...)
+error (const char * gmsgid, ...)
 {
   va_list ap;
 
-  va_start (ap, msgid);
+  va_start (ap, gmsgid);
   fprintf (stderr, "collect2: ");
-  vfprintf (stderr, _(msgid), ap);
+  vfprintf (stderr, _(gmsgid), ap);
   fprintf (stderr, "\n");
   va_end(ap);
 }
--- gcc/diagnostic.c.jj	2005-05-25 11:42:18.000000000 +0200
+++ gcc/diagnostic.c	2005-05-31 14:57:27.000000000 +0200
@@ -113,13 +113,13 @@ diagnostic_initialize (diagnostic_contex
 }
 
 void
-diagnostic_set_info (diagnostic_info *diagnostic, const char *msgid,
+diagnostic_set_info (diagnostic_info *diagnostic, const char *gmsgid,
 		     va_list *args, location_t location,
 		     diagnostic_t kind)
 {
   diagnostic->message.err_no = errno;
   diagnostic->message.args_ptr = args;
-  diagnostic->message.format_spec = _(msgid);
+  diagnostic->message.format_spec = _(gmsgid);
   diagnostic->location = location;
   diagnostic->kind = kind;
   diagnostic->option_index = 0;
@@ -396,15 +396,15 @@ trim_filename (const char *name)
 /* Text to be emitted verbatim to the error message stream; this
    produces no prefix and disables line-wrapping.  Use rarely.  */
 void
-verbatim (const char *msgid, ...)
+verbatim (const char *gmsgid, ...)
 {
   text_info text;
   va_list ap;
 
-  va_start (ap, msgid);
+  va_start (ap, gmsgid);
   text.err_no = errno;
   text.args_ptr = &ap;
-  text.format_spec = _(msgid);
+  text.format_spec = _(gmsgid);
   text.locus = NULL;
   pp_format_verbatim (global_dc->printer, &text);
   pp_flush (global_dc->printer);
@@ -414,13 +414,13 @@ verbatim (const char *msgid, ...)
 /* An informative note.  Use this for additional details on an error
    message.  */
 void
-inform (const char *msgid, ...)
+inform (const char *gmsgid, ...)
 {
   diagnostic_info diagnostic;
   va_list ap;
 
-  va_start (ap, msgid);
-  diagnostic_set_info (&diagnostic, msgid, &ap, input_location, DK_NOTE);
+  va_start (ap, gmsgid);
+  diagnostic_set_info (&diagnostic, gmsgid, &ap, input_location, DK_NOTE);
   report_diagnostic (&diagnostic);
   va_end (ap);
 }
@@ -428,13 +428,13 @@ inform (const char *msgid, ...)
 /* A warning.  Use this for code which is correct according to the
    relevant language specification but is likely to be buggy anyway.  */
 void
-warning (int opt, const char *msgid, ...)
+warning (int opt, const char *gmsgid, ...)
 {
   diagnostic_info diagnostic;
   va_list ap;
 
-  va_start (ap, msgid);
-  diagnostic_set_info (&diagnostic, msgid, &ap, input_location, DK_WARNING);
+  va_start (ap, gmsgid);
+  diagnostic_set_info (&diagnostic, gmsgid, &ap, input_location, DK_WARNING);
   diagnostic.option_index = opt;
 
   report_diagnostic (&diagnostic);
@@ -442,13 +442,13 @@ warning (int opt, const char *msgid, ...
 }
 
 void
-warning0 (const char *msgid, ...)
+warning0 (const char *gmsgid, ...)
 {
   diagnostic_info diagnostic;
   va_list ap;
 
-  va_start (ap, msgid);
-  diagnostic_set_info (&diagnostic, msgid, &ap, input_location, DK_WARNING);
+  va_start (ap, gmsgid);
+  diagnostic_set_info (&diagnostic, gmsgid, &ap, input_location, DK_WARNING);
   report_diagnostic (&diagnostic);
   va_end (ap);
 }
@@ -462,13 +462,13 @@ warning0 (const char *msgid, ...)
    of the -pedantic command-line switch.  To get a warning enabled
    only with that switch, write "if (pedantic) pedwarn (...);"  */
 void
-pedwarn (const char *msgid, ...)
+pedwarn (const char *gmsgid, ...)
 {
   diagnostic_info diagnostic;
   va_list ap;
 
-  va_start (ap, msgid);
-  diagnostic_set_info (&diagnostic, msgid, &ap, input_location,
+  va_start (ap, gmsgid);
+  diagnostic_set_info (&diagnostic, gmsgid, &ap, input_location,
 		       pedantic_error_kind ());
   report_diagnostic (&diagnostic);
   va_end (ap);
@@ -477,13 +477,13 @@ pedwarn (const char *msgid, ...)
 /* A hard error: the code is definitely ill-formed, and an object file
    will not be produced.  */
 void
-error (const char *msgid, ...)
+error (const char *gmsgid, ...)
 {
   diagnostic_info diagnostic;
   va_list ap;
 
-  va_start (ap, msgid);
-  diagnostic_set_info (&diagnostic, msgid, &ap, input_location, DK_ERROR);
+  va_start (ap, gmsgid);
+  diagnostic_set_info (&diagnostic, gmsgid, &ap, input_location, DK_ERROR);
   report_diagnostic (&diagnostic);
   va_end (ap);
 }
@@ -492,13 +492,13 @@ error (const char *msgid, ...)
    required by the relevant specification but not implemented by GCC.
    An object file will not be produced.  */
 void
-sorry (const char *msgid, ...)
+sorry (const char *gmsgid, ...)
 {
   diagnostic_info diagnostic;
   va_list ap;
 
-  va_start (ap, msgid);
-  diagnostic_set_info (&diagnostic, msgid, &ap, input_location, DK_SORRY);
+  va_start (ap, gmsgid);
+  diagnostic_set_info (&diagnostic, gmsgid, &ap, input_location, DK_SORRY);
   report_diagnostic (&diagnostic);
   va_end (ap);
 }
@@ -507,13 +507,13 @@ sorry (const char *msgid, ...)
    continue.  Do not use this for internal consistency checks; that's
    internal_error.  Use of this function should be rare.  */
 void
-fatal_error (const char *msgid, ...)
+fatal_error (const char *gmsgid, ...)
 {
   diagnostic_info diagnostic;
   va_list ap;
 
-  va_start (ap, msgid);
-  diagnostic_set_info (&diagnostic, msgid, &ap, input_location, DK_FATAL);
+  va_start (ap, gmsgid);
+  diagnostic_set_info (&diagnostic, gmsgid, &ap, input_location, DK_FATAL);
   report_diagnostic (&diagnostic);
   va_end (ap);
 
@@ -525,13 +525,13 @@ fatal_error (const char *msgid, ...)
    a more specific message, or some other good reason, you should use
    abort () instead of calling this function directly.  */
 void
-internal_error (const char *msgid, ...)
+internal_error (const char *gmsgid, ...)
 {
   diagnostic_info diagnostic;
   va_list ap;
 
-  va_start (ap, msgid);
-  diagnostic_set_info (&diagnostic, msgid, &ap, input_location, DK_ICE);
+  va_start (ap, gmsgid);
+  diagnostic_set_info (&diagnostic, gmsgid, &ap, input_location, DK_ICE);
   report_diagnostic (&diagnostic);
   va_end (ap);
 
@@ -544,12 +544,12 @@ internal_error (const char *msgid, ...)
 /* Print a diagnostic MSGID on FILE.  This is just fprintf, except it
    runs its second argument through gettext.  */
 void
-fnotice (FILE *file, const char *msgid, ...)
+fnotice (FILE *file, const char *cmsgid, ...)
 {
   va_list ap;
 
-  va_start (ap, msgid);
-  vfprintf (file, _(msgid), ap);
+  va_start (ap, cmsgid);
+  vfprintf (file, _(cmsgid), ap);
   va_end (ap);
 }
 
--- gcc/gcov.c.jj	2005-04-29 09:17:59.000000000 +0200
+++ gcc/gcov.c	2005-05-31 15:06:28.000000000 +0200
@@ -367,12 +367,12 @@ main (int argc, char **argv)
 }
 
 static void
-fnotice (FILE *file, const char *msgid, ...)
+fnotice (FILE *file, const char *cmsgid, ...)
 {
   va_list ap;
 
-  va_start (ap, msgid);
-  vfprintf (file, _(msgid), ap);
+  va_start (ap, cmsgid);
+  vfprintf (file, _(cmsgid), ap);
   va_end (ap);
 }
 
--- gcc/protoize.c.jj	2005-05-06 09:58:28.000000000 +0200
+++ gcc/protoize.c	2005-05-31 14:55:31.000000000 +0200
@@ -505,12 +505,12 @@ static char * saved_repl_write_ptr;
 
 /* Translate and output an error message.  */
 static void
-notice (const char *msgid, ...)
+notice (const char *cmsgid, ...)
 {
   va_list ap;
   
-  va_start (ap, msgid);
-  vfprintf (stderr, _(msgid), ap);
+  va_start (ap, cmsgid);
+  vfprintf (stderr, _(cmsgid), ap);
   va_end (ap);
 }
 
--- gcc/c-errors.c.jj	2003-07-29 17:02:29.000000000 +0200
+++ gcc/c-errors.c	2005-05-31 15:07:32.000000000 +0200
@@ -32,13 +32,13 @@ Software Foundation, 59 Temple Place - S
 /* Issue an ISO C99 pedantic warning MSGID.  */
 
 void
-pedwarn_c99 (const char *msgid, ...)
+pedwarn_c99 (const char *gmsgid, ...)
 {
   diagnostic_info diagnostic;
   va_list ap;
   
-  va_start (ap, msgid);
-  diagnostic_set_info (&diagnostic, msgid, &ap, input_location,
+  va_start (ap, gmsgid);
+  diagnostic_set_info (&diagnostic, gmsgid, &ap, input_location,
                        flag_isoc99 ? pedantic_error_kind () : DK_WARNING);
   report_diagnostic (&diagnostic);
   va_end (ap);
@@ -50,13 +50,13 @@ pedwarn_c99 (const char *msgid, ...)
    (There is no flag_c90.)  */
 
 void
-pedwarn_c90 (const char *msgid, ...)
+pedwarn_c90 (const char *gmsgid, ...)
 {
   diagnostic_info diagnostic;
   va_list ap;
 
-  va_start (ap, msgid);
-  diagnostic_set_info (&diagnostic, msgid, &ap, input_location,
+  va_start (ap, gmsgid);
+  diagnostic_set_info (&diagnostic, gmsgid, &ap, input_location,
                        flag_isoc99 ? DK_WARNING : pedantic_error_kind ());
   report_diagnostic (&diagnostic);
   va_end (ap);
--- gcc/c-common.c.jj	2005-05-19 09:31:09.000000000 +0200
+++ gcc/c-common.c	2005-05-31 14:28:49.000000000 +0200
@@ -5513,51 +5513,51 @@ catenate_strings (const char *lhs, const
   return result;
 }
 
-/* Issue the error given by MSGID, indicating that it occurred before
+/* Issue the error given by GMSGID, indicating that it occurred before
    TOKEN, which had the associated VALUE.  */
 
 void
-c_parse_error (const char *msgid, enum cpp_ttype token, tree value)
+c_parse_error (const char *gmsgid, enum cpp_ttype token, tree value)
 {
 #define catenate_messages(M1, M2) catenate_strings ((M1), (M2), sizeof (M2))
 
   char *message = NULL;
 
   if (token == CPP_EOF)
-    message = catenate_messages (msgid, " at end of input");
+    message = catenate_messages (gmsgid, " at end of input");
   else if (token == CPP_CHAR || token == CPP_WCHAR)
     {
       unsigned int val = TREE_INT_CST_LOW (value);
       const char *const ell = (token == CPP_CHAR) ? "" : "L";
       if (val <= UCHAR_MAX && ISGRAPH (val))
-        message = catenate_messages (msgid, " before %s'%c'");
+        message = catenate_messages (gmsgid, " before %s'%c'");
       else
-        message = catenate_messages (msgid, " before %s'\\x%x'");
+        message = catenate_messages (gmsgid, " before %s'\\x%x'");
 
       error (message, ell, val);
       free (message);
       message = NULL;
     }
   else if (token == CPP_STRING || token == CPP_WSTRING)
-    message = catenate_messages (msgid, " before string constant");
+    message = catenate_messages (gmsgid, " before string constant");
   else if (token == CPP_NUMBER)
-    message = catenate_messages (msgid, " before numeric constant");
+    message = catenate_messages (gmsgid, " before numeric constant");
   else if (token == CPP_NAME)
     {
-      message = catenate_messages (msgid, " before %qE");
+      message = catenate_messages (gmsgid, " before %qE");
       error (message, value);
       free (message);
       message = NULL;
     }
   else if (token < N_TTYPES)
     {
-      message = catenate_messages (msgid, " before %qs token");
+      message = catenate_messages (gmsgid, " before %qs token");
       error (message, cpp_type2name (token));
       free (message);
       message = NULL;
     }
   else
-    error (msgid);
+    error (gmsgid);
 
   if (message)
     {
--- gcc/final.c.jj	2005-04-29 09:17:56.000000000 +0200
+++ gcc/final.c	2005-05-31 14:26:50.000000000 +0200
@@ -2753,7 +2753,7 @@ alter_cond (rtx cond)
    In an `asm', it's the user's fault; otherwise, the compiler's fault.  */
 
 void
-output_operand_lossage (const char *msgid, ...)
+output_operand_lossage (const char *cmsgid, ...)
 {
   char *fmt_string;
   char *new_message;


	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]