From 4b794eaf73ef8df7689d1e9de146e00398f2d1fd Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Mon, 6 Jun 2005 21:31:40 +0200 Subject: exgettext: Handle gmsgid and cmsgid arguments specially, as gcc-internal-format and c-format. gcc/po/ * exgettext: Handle gmsgid and cmsgid arguments specially, as gcc-internal-format and c-format. Because of xgettext bug, invoke xgettext once with --language=c, once with --language=GCC-source and then merge together. Fail if xgettext is not 0.14.5 or later. gcc/ * intl.h (G_): New macro. * rtl-error.c (error_for_asm, warning_for_asm): Use gmsgid instead of msgid for argument name. * tree-ssa.c (warn_uninit): Likewise. * c-parser.c (c_parser_error): Likewise. * config/rs6000/rs6000-c.c (SYNTAX_ERROR): Likewise. * config/darwin-c.c (BAD): Likewise. * config/c4x/c4x-c.c (BAD): Likewise. * c-pragma.c (GCC_BAD, GCC_BAD2): Likewise. * c-errors.c (pedwarn_c99, pedwarn_c90): Likewise. * c-common.c (c_parse_error): Likewise. * diagnostic.c (diagnostic_set_info, verbatim, inform, warning, warning0, pedwarn, error, sorry, fatal_error, internal_error): Likewise. (fnotice): Use cmsgid instead of msgid for argument name. * gcov.c (fnotice): Likewise. * protoize.c (notice): Likewise. * final.c (output_operand_lossage): Likewise. * gcc.c (fatal, notice): Likewise. (error): Use gmsgid instead of msgid for argument name. * collect2.c (notice, fatal_perror, fatal): Use cmsgid instead of msgid for argument name. (error): Use gmsgid instead of msgid for argument name. * c-decl.c (locate_old_decl, implicit_decl_warning): Use G_() instead of N_(). * c-typeck.c (readonly_error, convert_for_assignment): Likewise. * tree-inline.c (inline_forbidden_p_1): Likewise. * ABOUT-GCC-NLS: Require gettext 0.14.5 or later. Mention the new conventions for marking translations. * doc/install.texi: Mention gettext 0.14.5 or later requirement. gcc/cp/ * error.c (locate_error): Use gmsgid instead of msgid for argument name. (cp_error_at, cp_warning_at, cp_pedwarn_at): Likewise. gcc/java/ * jv-scan.c (fatal_error, warning, warning0): Use gmsgid instead of msgid for argument name. * gjavah.c (error): Likewise. * java-tree.h (parse_error_context): Likewise. * parse.y (parse_error_context, parse_warning_context, issue_warning_error_from_context): Likewise. From-SVN: r100676 --- gcc/gcc.c | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'gcc/gcc.c') diff --git a/gcc/gcc.c b/gcc/gcc.c index 0820bd7..9be4a29 100644 --- a/gcc/gcc.c +++ b/gcc/gcc.c @@ -6716,40 +6716,46 @@ fancy_abort (const char *file, int line, const char *func) /* 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); } -- cgit v1.1