Commit 380c6697 authored by jakub's avatar jakub

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.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@100676 138bc75d-0d04-0410-961f-82ee72b054a4
parent b74b8216
...@@ -25,15 +25,22 @@ responsibility to translate the message before the user sees it. ...@@ -25,15 +25,22 @@ responsibility to translate the message before the user sees it.
By convention, any function parameter in the GCC sources whose name By convention, any function parameter in the GCC sources whose name
ends in `msgid' is expected to be a message requiring translation. ends in `msgid' is expected to be a message requiring translation.
For example, the `error' function's first parameter is named `msgid'. If the parameter name ends with `gmsgid', it is assumed to be a GCC
diagnostics format string requiring translation, if it ends with
`cmsgid', it is assumed to be a format string for `printf' family
of functions, requiring a translation.
For example, the `error' function's first parameter is named `gmsgid'.
GCC's exgettext script uses this convention to determine which GCC's exgettext script uses this convention to determine which
function parameter strings need to be translated. The exgettext function parameter strings need to be translated. The exgettext
script also assumes that any occurrence of `%eMSGID}' on a source script also assumes that any occurrence of `%eMSGID}' on a source
line, where MSGID does not contain `%' or `}', corresponds to a line, where MSGID does not contain `%' or `}', corresponds to a
message MSGID that requires translation; this is needed to identify message MSGID that requires translation; this is needed to identify
diagnostics in GCC spec strings. diagnostics in GCC spec strings.
The `G_(GMSGID)' macro defined in intl.h can be used to mark GCC diagnostics
format strings as requiring translation, but other than that it is a
no-op at runtime.
If you modify source files, you'll need at least version 0.10.37 of the If you modify source files, you'll need at least version 0.14.15 of the
GNU gettext package to propagate the modifications to the translation GNU gettext package to propagate the modifications to the translation
tables. tables.
......
2005-06-06 Jakub Jelinek <jakub@redhat.com> 2005-06-06 Jakub Jelinek <jakub@redhat.com>
* 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.
* tree-chrec.c (reset_evolution_in_loop): Use build3 instead of * tree-chrec.c (reset_evolution_in_loop): Use build3 instead of
build2. build2.
......
...@@ -5520,51 +5520,51 @@ catenate_strings (const char *lhs, const char *rhs_start, int rhs_size) ...@@ -5520,51 +5520,51 @@ catenate_strings (const char *lhs, const char *rhs_start, int rhs_size)
return result; 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. */ TOKEN, which had the associated VALUE. */
void 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)) #define catenate_messages(M1, M2) catenate_strings ((M1), (M2), sizeof (M2))
char *message = NULL; char *message = NULL;
if (token == CPP_EOF) 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) else if (token == CPP_CHAR || token == CPP_WCHAR)
{ {
unsigned int val = TREE_INT_CST_LOW (value); unsigned int val = TREE_INT_CST_LOW (value);
const char *const ell = (token == CPP_CHAR) ? "" : "L"; const char *const ell = (token == CPP_CHAR) ? "" : "L";
if (val <= UCHAR_MAX && ISGRAPH (val)) if (val <= UCHAR_MAX && ISGRAPH (val))
message = catenate_messages (msgid, " before %s'%c'"); message = catenate_messages (gmsgid, " before %s'%c'");
else else
message = catenate_messages (msgid, " before %s'\\x%x'"); message = catenate_messages (gmsgid, " before %s'\\x%x'");
error (message, ell, val); error (message, ell, val);
free (message); free (message);
message = NULL; message = NULL;
} }
else if (token == CPP_STRING || token == CPP_WSTRING) 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) else if (token == CPP_NUMBER)
message = catenate_messages (msgid, " before numeric constant"); message = catenate_messages (gmsgid, " before numeric constant");
else if (token == CPP_NAME) else if (token == CPP_NAME)
{ {
message = catenate_messages (msgid, " before %qE"); message = catenate_messages (gmsgid, " before %qE");
error (message, value); error (message, value);
free (message); free (message);
message = NULL; message = NULL;
} }
else if (token < N_TTYPES) else if (token < N_TTYPES)
{ {
message = catenate_messages (msgid, " before %qs token"); message = catenate_messages (gmsgid, " before %qs token");
error (message, cpp_type2name (token)); error (message, cpp_type2name (token));
free (message); free (message);
message = NULL; message = NULL;
} }
else else
error (msgid); error (gmsgid);
if (message) if (message)
{ {
......
...@@ -1131,11 +1131,11 @@ locate_old_decl (tree decl, void (*diag)(const char *, ...)) ...@@ -1131,11 +1131,11 @@ locate_old_decl (tree decl, void (*diag)(const char *, ...))
if (TREE_CODE (decl) == FUNCTION_DECL && DECL_BUILT_IN (decl)) if (TREE_CODE (decl) == FUNCTION_DECL && DECL_BUILT_IN (decl))
; ;
else if (DECL_INITIAL (decl)) else if (DECL_INITIAL (decl))
diag (N_("%Jprevious definition of %qD was here"), decl, decl); diag (G_("%Jprevious definition of %qD was here"), decl, decl);
else if (C_DECL_IMPLICIT (decl)) else if (C_DECL_IMPLICIT (decl))
diag (N_("%Jprevious implicit declaration of %qD was here"), decl, decl); diag (G_("%Jprevious implicit declaration of %qD was here"), decl, decl);
else else
diag (N_("%Jprevious declaration of %qD was here"), decl, decl); diag (G_("%Jprevious declaration of %qD was here"), decl, decl);
} }
/* Subroutine of duplicate_decls. Compare NEWDECL to OLDDECL. /* Subroutine of duplicate_decls. Compare NEWDECL to OLDDECL.
...@@ -2292,7 +2292,7 @@ implicit_decl_warning (tree id, tree olddecl) ...@@ -2292,7 +2292,7 @@ implicit_decl_warning (tree id, tree olddecl)
default: gcc_unreachable (); default: gcc_unreachable ();
} }
diag (N_("implicit declaration of function %qE"), id); diag (G_("implicit declaration of function %qE"), id);
if (olddecl) if (olddecl)
locate_old_decl (olddecl, diag); locate_old_decl (olddecl, diag);
} }
......
...@@ -32,13 +32,13 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA ...@@ -32,13 +32,13 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
/* Issue an ISO C99 pedantic warning MSGID. */ /* Issue an ISO C99 pedantic warning MSGID. */
void void
pedwarn_c99 (const char *msgid, ...) pedwarn_c99 (const char *gmsgid, ...)
{ {
diagnostic_info diagnostic; diagnostic_info diagnostic;
va_list ap; va_list ap;
va_start (ap, msgid); va_start (ap, gmsgid);
diagnostic_set_info (&diagnostic, msgid, &ap, input_location, diagnostic_set_info (&diagnostic, gmsgid, &ap, input_location,
flag_isoc99 ? pedantic_error_kind () : DK_WARNING); flag_isoc99 ? pedantic_error_kind () : DK_WARNING);
report_diagnostic (&diagnostic); report_diagnostic (&diagnostic);
va_end (ap); va_end (ap);
...@@ -50,13 +50,13 @@ pedwarn_c99 (const char *msgid, ...) ...@@ -50,13 +50,13 @@ pedwarn_c99 (const char *msgid, ...)
(There is no flag_c90.) */ (There is no flag_c90.) */
void void
pedwarn_c90 (const char *msgid, ...) pedwarn_c90 (const char *gmsgid, ...)
{ {
diagnostic_info diagnostic; diagnostic_info diagnostic;
va_list ap; va_list ap;
va_start (ap, msgid); va_start (ap, gmsgid);
diagnostic_set_info (&diagnostic, msgid, &ap, input_location, diagnostic_set_info (&diagnostic, gmsgid, &ap, input_location,
flag_isoc99 ? DK_WARNING : pedantic_error_kind ()); flag_isoc99 ? DK_WARNING : pedantic_error_kind ());
report_diagnostic (&diagnostic); report_diagnostic (&diagnostic);
va_end (ap); va_end (ap);
......
...@@ -635,18 +635,18 @@ c_parser_new (void) ...@@ -635,18 +635,18 @@ c_parser_new (void)
used. */ used. */
static void static void
c_parser_error (c_parser *parser, const char *msgid) c_parser_error (c_parser *parser, const char *gmsgid)
{ {
c_token *token = c_parser_peek_token (parser); c_token *token = c_parser_peek_token (parser);
if (parser->error) if (parser->error)
return; return;
parser->error = true; parser->error = true;
if (!msgid) if (!gmsgid)
return; return;
/* This diagnostic makes more sense if it is tagged to the line of /* This diagnostic makes more sense if it is tagged to the line of
the token we just peeked at. */ the token we just peeked at. */
c_parser_set_source_position_from_token (token); c_parser_set_source_position_from_token (token);
c_parse_error (msgid, c_parse_error (gmsgid,
/* Because c_parse_error does not understand /* Because c_parse_error does not understand
CPP_KEYWORD, keywords are treated like CPP_KEYWORD, keywords are treated like
identifiers. */ identifiers. */
......
...@@ -37,8 +37,9 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA ...@@ -37,8 +37,9 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "vec.h" #include "vec.h"
#include "target.h" #include "target.h"
#define GCC_BAD(msgid) do { warning (0, msgid); return; } while (0) #define GCC_BAD(gmsgid) do { warning (0, gmsgid); return; } while (0)
#define GCC_BAD2(msgid, arg) do { warning (0, msgid, arg); return; } while (0) #define GCC_BAD2(gmsgid, arg) \
do { warning (0, gmsgid, arg); return; } while (0)
typedef struct align_stack GTY(()) typedef struct align_stack GTY(())
{ {
......
...@@ -2845,20 +2845,20 @@ readonly_error (tree arg, enum lvalue_use use) ...@@ -2845,20 +2845,20 @@ readonly_error (tree arg, enum lvalue_use use)
if (TYPE_READONLY (TREE_TYPE (TREE_OPERAND (arg, 0)))) if (TYPE_READONLY (TREE_TYPE (TREE_OPERAND (arg, 0))))
readonly_error (TREE_OPERAND (arg, 0), use); readonly_error (TREE_OPERAND (arg, 0), use);
else else
error (READONLY_MSG (N_("assignment of read-only member %qD"), error (READONLY_MSG (G_("assignment of read-only member %qD"),
N_("increment of read-only member %qD"), G_("increment of read-only member %qD"),
N_("decrement of read-only member %qD")), G_("decrement of read-only member %qD")),
TREE_OPERAND (arg, 1)); TREE_OPERAND (arg, 1));
} }
else if (TREE_CODE (arg) == VAR_DECL) else if (TREE_CODE (arg) == VAR_DECL)
error (READONLY_MSG (N_("assignment of read-only variable %qD"), error (READONLY_MSG (G_("assignment of read-only variable %qD"),
N_("increment of read-only variable %qD"), G_("increment of read-only variable %qD"),
N_("decrement of read-only variable %qD")), G_("decrement of read-only variable %qD")),
arg); arg);
else else
error (READONLY_MSG (N_("assignment of read-only location"), error (READONLY_MSG (G_("assignment of read-only location"),
N_("increment of read-only location"), G_("increment of read-only location"),
N_("decrement of read-only location"))); G_("decrement of read-only location")));
} }
...@@ -3728,26 +3728,26 @@ convert_for_assignment (tree type, tree rhs, enum impl_conv errtype, ...@@ -3728,26 +3728,26 @@ convert_for_assignment (tree type, tree rhs, enum impl_conv errtype,
function where an ordinary one is wanted, but not function where an ordinary one is wanted, but not
vice-versa. */ vice-versa. */
if (TYPE_QUALS (ttl) & ~TYPE_QUALS (ttr)) if (TYPE_QUALS (ttl) & ~TYPE_QUALS (ttr))
WARN_FOR_ASSIGNMENT (N_("passing argument %d of %qE " WARN_FOR_ASSIGNMENT (G_("passing argument %d of %qE "
"makes qualified function " "makes qualified function "
"pointer from unqualified"), "pointer from unqualified"),
N_("assignment makes qualified " G_("assignment makes qualified "
"function pointer from " "function pointer from "
"unqualified"), "unqualified"),
N_("initialization makes qualified " G_("initialization makes qualified "
"function pointer from " "function pointer from "
"unqualified"), "unqualified"),
N_("return makes qualified function " G_("return makes qualified function "
"pointer from unqualified")); "pointer from unqualified"));
} }
else if (TYPE_QUALS (ttr) & ~TYPE_QUALS (ttl)) else if (TYPE_QUALS (ttr) & ~TYPE_QUALS (ttl))
WARN_FOR_ASSIGNMENT (N_("passing argument %d of %qE discards " WARN_FOR_ASSIGNMENT (G_("passing argument %d of %qE discards "
"qualifiers from pointer target type"), "qualifiers from pointer target type"),
N_("assignment discards qualifiers " G_("assignment discards qualifiers "
"from pointer target type"), "from pointer target type"),
N_("initialization discards qualifiers " G_("initialization discards qualifiers "
"from pointer target type"), "from pointer target type"),
N_("return discards qualifiers from " G_("return discards qualifiers from "
"pointer target type")); "pointer target type"));
} }
...@@ -3796,14 +3796,14 @@ convert_for_assignment (tree type, tree rhs, enum impl_conv errtype, ...@@ -3796,14 +3796,14 @@ convert_for_assignment (tree type, tree rhs, enum impl_conv errtype,
which are not ANSI null ptr constants. */ which are not ANSI null ptr constants. */
&& (!integer_zerop (rhs) || TREE_CODE (rhs) == NOP_EXPR) && (!integer_zerop (rhs) || TREE_CODE (rhs) == NOP_EXPR)
&& TREE_CODE (ttl) == FUNCTION_TYPE))) && TREE_CODE (ttl) == FUNCTION_TYPE)))
WARN_FOR_ASSIGNMENT (N_("ISO C forbids passing argument %d of " WARN_FOR_ASSIGNMENT (G_("ISO C forbids passing argument %d of "
"%qE between function pointer " "%qE between function pointer "
"and %<void *%>"), "and %<void *%>"),
N_("ISO C forbids assignment between " G_("ISO C forbids assignment between "
"function pointer and %<void *%>"), "function pointer and %<void *%>"),
N_("ISO C forbids initialization between " G_("ISO C forbids initialization between "
"function pointer and %<void *%>"), "function pointer and %<void *%>"),
N_("ISO C forbids return between function " G_("ISO C forbids return between function "
"pointer and %<void *%>")); "pointer and %<void *%>"));
/* Const and volatile mean something different for function types, /* Const and volatile mean something different for function types,
so the usual warnings are not appropriate. */ so the usual warnings are not appropriate. */
...@@ -3816,13 +3816,13 @@ convert_for_assignment (tree type, tree rhs, enum impl_conv errtype, ...@@ -3816,13 +3816,13 @@ convert_for_assignment (tree type, tree rhs, enum impl_conv errtype,
qualifier are acceptable if the 'volatile' has been added qualifier are acceptable if the 'volatile' has been added
in by the Objective-C EH machinery. */ in by the Objective-C EH machinery. */
if (!objc_type_quals_match (ttl, ttr)) if (!objc_type_quals_match (ttl, ttr))
WARN_FOR_ASSIGNMENT (N_("passing argument %d of %qE discards " WARN_FOR_ASSIGNMENT (G_("passing argument %d of %qE discards "
"qualifiers from pointer target type"), "qualifiers from pointer target type"),
N_("assignment discards qualifiers " G_("assignment discards qualifiers "
"from pointer target type"), "from pointer target type"),
N_("initialization discards qualifiers " G_("initialization discards qualifiers "
"from pointer target type"), "from pointer target type"),
N_("return discards qualifiers from " G_("return discards qualifiers from "
"pointer target type")); "pointer target type"));
} }
/* If this is not a case of ignoring a mismatch in signedness, /* If this is not a case of ignoring a mismatch in signedness,
...@@ -3832,13 +3832,13 @@ convert_for_assignment (tree type, tree rhs, enum impl_conv errtype, ...@@ -3832,13 +3832,13 @@ convert_for_assignment (tree type, tree rhs, enum impl_conv errtype,
; ;
/* If there is a mismatch, do warn. */ /* If there is a mismatch, do warn. */
else if (warn_pointer_sign) else if (warn_pointer_sign)
WARN_FOR_ASSIGNMENT (N_("pointer targets in passing argument " WARN_FOR_ASSIGNMENT (G_("pointer targets in passing argument "
"%d of %qE differ in signedness"), "%d of %qE differ in signedness"),
N_("pointer targets in assignment " G_("pointer targets in assignment "
"differ in signedness"), "differ in signedness"),
N_("pointer targets in initialization " G_("pointer targets in initialization "
"differ in signedness"), "differ in signedness"),
N_("pointer targets in return differ " G_("pointer targets in return differ "
"in signedness")); "in signedness"));
} }
else if (TREE_CODE (ttl) == FUNCTION_TYPE else if (TREE_CODE (ttl) == FUNCTION_TYPE
...@@ -3849,26 +3849,26 @@ convert_for_assignment (tree type, tree rhs, enum impl_conv errtype, ...@@ -3849,26 +3849,26 @@ convert_for_assignment (tree type, tree rhs, enum impl_conv errtype,
it is okay to use a const or volatile function it is okay to use a const or volatile function
where an ordinary one is wanted, but not vice-versa. */ where an ordinary one is wanted, but not vice-versa. */
if (TYPE_QUALS (ttl) & ~TYPE_QUALS (ttr)) if (TYPE_QUALS (ttl) & ~TYPE_QUALS (ttr))
WARN_FOR_ASSIGNMENT (N_("passing argument %d of %qE makes " WARN_FOR_ASSIGNMENT (G_("passing argument %d of %qE makes "
"qualified function pointer " "qualified function pointer "
"from unqualified"), "from unqualified"),
N_("assignment makes qualified function " G_("assignment makes qualified function "
"pointer from unqualified"), "pointer from unqualified"),
N_("initialization makes qualified " G_("initialization makes qualified "
"function pointer from unqualified"), "function pointer from unqualified"),
N_("return makes qualified function " G_("return makes qualified function "
"pointer from unqualified")); "pointer from unqualified"));
} }
} }
else else
/* Avoid warning about the volatile ObjC EH puts on decls. */ /* Avoid warning about the volatile ObjC EH puts on decls. */
if (!objc_ok) if (!objc_ok)
WARN_FOR_ASSIGNMENT (N_("passing argument %d of %qE from " WARN_FOR_ASSIGNMENT (G_("passing argument %d of %qE from "
"incompatible pointer type"), "incompatible pointer type"),
N_("assignment from incompatible pointer type"), G_("assignment from incompatible pointer type"),
N_("initialization from incompatible " G_("initialization from incompatible "
"pointer type"), "pointer type"),
N_("return from incompatible pointer type")); G_("return from incompatible pointer type"));
return convert (type, rhs); return convert (type, rhs);
} }
...@@ -3890,26 +3890,26 @@ convert_for_assignment (tree type, tree rhs, enum impl_conv errtype, ...@@ -3890,26 +3890,26 @@ convert_for_assignment (tree type, tree rhs, enum impl_conv errtype,
&& TREE_CODE (TREE_TYPE (rhs)) == INTEGER_TYPE && TREE_CODE (TREE_TYPE (rhs)) == INTEGER_TYPE
&& TREE_CODE (TREE_OPERAND (rhs, 0)) == INTEGER_CST && TREE_CODE (TREE_OPERAND (rhs, 0)) == INTEGER_CST
&& integer_zerop (TREE_OPERAND (rhs, 0)))) && integer_zerop (TREE_OPERAND (rhs, 0))))
WARN_FOR_ASSIGNMENT (N_("passing argument %d of %qE makes " WARN_FOR_ASSIGNMENT (G_("passing argument %d of %qE makes "
"pointer from integer without a cast"), "pointer from integer without a cast"),
N_("assignment makes pointer from integer " G_("assignment makes pointer from integer "
"without a cast"), "without a cast"),
N_("initialization makes pointer from " G_("initialization makes pointer from "
"integer without a cast"), "integer without a cast"),
N_("return makes pointer from integer " G_("return makes pointer from integer "
"without a cast")); "without a cast"));
return convert (type, rhs); return convert (type, rhs);
} }
else if (codel == INTEGER_TYPE && coder == POINTER_TYPE) else if (codel == INTEGER_TYPE && coder == POINTER_TYPE)
{ {
WARN_FOR_ASSIGNMENT (N_("passing argument %d of %qE makes integer " WARN_FOR_ASSIGNMENT (G_("passing argument %d of %qE makes integer "
"from pointer without a cast"), "from pointer without a cast"),
N_("assignment makes integer from pointer " G_("assignment makes integer from pointer "
"without a cast"), "without a cast"),
N_("initialization makes integer from pointer " G_("initialization makes integer from pointer "
"without a cast"), "without a cast"),
N_("return makes integer from pointer " G_("return makes integer from pointer "
"without a cast")); "without a cast"));
return convert (type, rhs); return convert (type, rhs);
} }
......
...@@ -328,26 +328,26 @@ collect_exit (int status) ...@@ -328,26 +328,26 @@ collect_exit (int status)
/* Notify user of a non-error. */ /* Notify user of a non-error. */
void void
notice (const char *msgid, ...) notice (const char *cmsgid, ...)
{ {
va_list ap; va_list ap;
va_start (ap, msgid); va_start (ap, cmsgid);
vfprintf (stderr, _(msgid), ap); vfprintf (stderr, _(cmsgid), ap);
va_end (ap); va_end (ap);
} }
/* Die when sys call fails. */ /* Die when sys call fails. */
void void
fatal_perror (const char * msgid, ...) fatal_perror (const char * cmsgid, ...)
{ {
int e = errno; int e = errno;
va_list ap; va_list ap;
va_start (ap, msgid); va_start (ap, cmsgid);
fprintf (stderr, "collect2: "); fprintf (stderr, "collect2: ");
vfprintf (stderr, _(msgid), ap); vfprintf (stderr, _(cmsgid), ap);
fprintf (stderr, ": %s\n", xstrerror (e)); fprintf (stderr, ": %s\n", xstrerror (e));
va_end (ap); va_end (ap);
...@@ -357,13 +357,13 @@ fatal_perror (const char * msgid, ...) ...@@ -357,13 +357,13 @@ fatal_perror (const char * msgid, ...)
/* Just die. */ /* Just die. */
void void
fatal (const char * msgid, ...) fatal (const char * cmsgid, ...)
{ {
va_list ap; va_list ap;
va_start (ap, msgid); va_start (ap, cmsgid);
fprintf (stderr, "collect2: "); fprintf (stderr, "collect2: ");
vfprintf (stderr, _(msgid), ap); vfprintf (stderr, _(cmsgid), ap);
fprintf (stderr, "\n"); fprintf (stderr, "\n");
va_end (ap); va_end (ap);
...@@ -373,13 +373,13 @@ fatal (const char * msgid, ...) ...@@ -373,13 +373,13 @@ fatal (const char * msgid, ...)
/* Write error message. */ /* Write error message. */
void void
error (const char * msgid, ...) error (const char * gmsgid, ...)
{ {
va_list ap; va_list ap;
va_start (ap, msgid); va_start (ap, gmsgid);
fprintf (stderr, "collect2: "); fprintf (stderr, "collect2: ");
vfprintf (stderr, _(msgid), ap); vfprintf (stderr, _(gmsgid), ap);
fprintf (stderr, "\n"); fprintf (stderr, "\n");
va_end(ap); va_end(ap);
} }
......
...@@ -57,7 +57,7 @@ static int c4x_parse_pragma (const char *, tree *, tree *); ...@@ -57,7 +57,7 @@ static int c4x_parse_pragma (const char *, tree *, tree *);
the STRING_CST node of the string. If SECT is null, then this 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, pragma doesn't take a section string. Returns 0 for a good pragma,
-1 for a malformed 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 static int
c4x_parse_pragma (name, func, sect) c4x_parse_pragma (name, func, sect)
......
...@@ -35,7 +35,7 @@ Boston, MA 02111-1307, USA. */ ...@@ -35,7 +35,7 @@ Boston, MA 02111-1307, USA. */
/* Pragmas. */ /* 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; static bool using_frameworks = false;
......
...@@ -50,8 +50,8 @@ static tree altivec_resolve_overloaded_builtin (tree, tree); ...@@ -50,8 +50,8 @@ static tree altivec_resolve_overloaded_builtin (tree, tree);
whether or not new function declarations receive a longcall whether or not new function declarations receive a longcall
attribute by default. */ attribute by default. */
#define SYNTAX_ERROR(msgid) do { \ #define SYNTAX_ERROR(gmsgid) do { \
warning (0, msgid); \ warning (0, gmsgid); \
warning (0, "ignoring malformed #pragma longcall"); \ warning (0, "ignoring malformed #pragma longcall"); \
return; \ return; \
} while (0) } while (0)
......
2005-06-06 Jakub Jelinek <jakub@redhat.com>
* error.c (locate_error): Use gmsgid instead of msgid for argument
name.
(cp_error_at, cp_warning_at, cp_pedwarn_at): Likewise.
2005-06-06 Nathan Sidwell <nathan@codesourcery.com> 2005-06-06 Nathan Sidwell <nathan@codesourcery.com>
PR 21903 PR 21903
......
...@@ -2319,13 +2319,13 @@ cp_printer (pretty_printer *pp, text_info *text) ...@@ -2319,13 +2319,13 @@ cp_printer (pretty_printer *pp, text_info *text)
behavior of cp_*_at. */ behavior of cp_*_at. */
static tree static tree
locate_error (const char *msgid, va_list ap) locate_error (const char *gmsgid, va_list ap)
{ {
tree here = 0, t; tree here = 0, t;
int plus = 0; int plus = 0;
const char *f; const char *f;