diff options
-rw-r--r-- | gcc/ChangeLog | 20 | ||||
-rw-r--r-- | gcc/c-decl.c | 46 | ||||
-rw-r--r-- | gcc/c-format.c | 16 | ||||
-rw-r--r-- | gcc/c-lex.c | 8 | ||||
-rw-r--r-- | gcc/c-typeck.c | 29 |
5 files changed, 84 insertions, 35 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a7e6c7a4d30..dabf4f7ecc4 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,23 @@ +2001-10-30 Paolo Bonzini <bonzini@gnu.org> + + Localization fixes. + * c-decl.c (parmlist_tags_warning, start_struct, + check_for_loop_decls): Separate messages for struct, union and + enum cases to allow for languages in which they have different + genders. + * c-format.c (scanf_flag_specs): Separate short and long name of + the assignment suppression feature. + (check_format_types): Localize "pointer" and "different types" + strings. + * c-lex.c (lex_number): Localize "an unsigned long int" and + related strings. + (lex_string) [MULTIBYTE_CHARS]: Use initial lowercase letter on + warning message. + * c-typeck.c (build_unary_up): Separate messages for increment and + decrement cases to allow for languages in which they use different + articles. Localize the strings "increment" and "decrement" in one + case. + Tue Oct 30 11:08:11 CET 2001 Jan Hubicka <jh@suse.cz> * lcm.c (optimize_mode_switching): Do not rebuild liveness information diff --git a/gcc/c-decl.c b/gcc/c-decl.c index 58bac423d5f..c840057f346 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -5317,11 +5317,17 @@ parmlist_tags_warning () if (code == UNION_TYPE && TREE_PURPOSE (elt) == 0 && !pedantic) continue; if (TREE_PURPOSE (elt) != 0) - warning ("`%s %s' declared inside parameter list", - (code == RECORD_TYPE ? "struct" - : code == UNION_TYPE ? "union" - : "enum"), - IDENTIFIER_POINTER (TREE_PURPOSE (elt))); + { + if (code == RECORD_TYPE) + warning ("`struct %s' declared inside parameter list", + IDENTIFIER_POINTER (TREE_PURPOSE (elt))); + else if (code == UNION_TYPE) + warning ("`union %s' declared inside parameter list", + IDENTIFIER_POINTER (TREE_PURPOSE (elt))); + else + warning ("`enum %s' declared inside parameter list", + IDENTIFIER_POINTER (TREE_PURPOSE (elt))); + } else { /* For translation these need to be separate warnings */ @@ -5411,9 +5417,14 @@ start_struct (code, name) C_TYPE_BEING_DEFINED (ref) = 1; TYPE_PACKED (ref) = flag_pack_struct; if (TYPE_FIELDS (ref)) - error ("redefinition of `%s %s'", - code == UNION_TYPE ? "union" : "struct", - IDENTIFIER_POINTER (name)); + { + if (code == UNION_TYPE) + error ("redefinition of `union %s'", + IDENTIFIER_POINTER (name)); + else + error ("redefinition of `struct %s'", + IDENTIFIER_POINTER (name)); + } return ref; } @@ -6995,12 +7006,21 @@ check_for_loop_decls () for (t = gettags (); t; t = TREE_CHAIN (t)) { if (TREE_PURPOSE (t) != 0) - error ("`%s %s' declared in `for' loop initial declaration", - (TREE_CODE (TREE_VALUE (t)) == RECORD_TYPE ? "struct" - : TREE_CODE (TREE_VALUE (t)) == UNION_TYPE ? "union" - : "enum"), - IDENTIFIER_POINTER (TREE_PURPOSE (t))); + { + enum tree_code code = TREE_CODE (TREE_VALUE (t)); + + if (code == RECORD_TYPE) + error ("`struct %s' declared in `for' loop initial declaration", + IDENTIFIER_POINTER (TREE_PURPOSE (t))); + else if (code == UNION_TYPE) + error ("`union %s' declared in `for' loop initial declaration", + IDENTIFIER_POINTER (TREE_PURPOSE (t))); + else + error ("`enum %s' declared in `for' loop initial declaration", + IDENTIFIER_POINTER (TREE_PURPOSE (t))); + } } + for (t = getdecls (); t; t = TREE_CHAIN (t)) { if (TREE_CODE (t) != VAR_DECL && DECL_NAME (t)) diff --git a/gcc/c-format.c b/gcc/c-format.c index 5a52723ba12..b224a8909bd 100644 --- a/gcc/c-format.c +++ b/gcc/c-format.c @@ -639,12 +639,12 @@ static const format_flag_pair printf_flag_pairs[] = static const format_flag_spec scanf_flag_specs[] = { - { '*', 0, 0, N_("assignment suppression"), N_("assignment suppression"), STD_C89 }, - { 'a', 0, 0, N_("`a' flag"), N_("the `a' scanf flag"), STD_EXT }, - { 'w', 0, 0, N_("field width"), N_("field width in scanf format"), STD_C89 }, - { 'L', 0, 0, N_("length modifier"), N_("length modifier in scanf format"), STD_C89 }, - { '\'', 0, 0, N_("`'' flag"), N_("the `'' scanf flag"), STD_EXT }, - { 'I', 0, 0, N_("`I' flag"), N_("the `I' scanf flag"), STD_EXT }, + { '*', 0, 0, N_("assignment suppression"), N_("the assignment suppression scanf feature"), STD_C89 }, + { 'a', 0, 0, N_("`a' flag"), N_("the `a' scanf flag"), STD_EXT }, + { 'w', 0, 0, N_("field width"), N_("field width in scanf format"), STD_C89 }, + { 'L', 0, 0, N_("length modifier"), N_("length modifier in scanf format"), STD_C89 }, + { '\'', 0, 0, N_("`'' flag"), N_("the `'' scanf flag"), STD_EXT }, + { 'I', 0, 0, N_("`I' flag"), N_("the `I' scanf flag"), STD_EXT }, { 0, 0, 0, NULL, NULL, 0 } }; @@ -2385,9 +2385,9 @@ check_format_types (status, types) if (that == 0) { if (TREE_CODE (orig_cur_type) == POINTER_TYPE) - that = "pointer"; + that = _("pointer"); else - that = "different type"; + that = _("different type"); } /* Make the warning better in case of mismatch of int vs long. */ diff --git a/gcc/c-lex.c b/gcc/c-lex.c index bbe8dc7c117..ca59266c2c8 100644 --- a/gcc/c-lex.c +++ b/gcc/c-lex.c @@ -1258,9 +1258,9 @@ lex_number (str, len) pedwarn ("integer constant larger than the maximum value of %s", (flag_isoc99 ? (TREE_UNSIGNED (type) - ? "an unsigned long long int" - : "a long long int") - : "an unsigned long int")); + ? _("an unsigned long long int") + : _("a long long int")) + : _("an unsigned long int"))); } if (base == 10 && ! spec_unsigned && TREE_UNSIGNED (type)) @@ -1333,7 +1333,7 @@ lex_string (str, len, wide) char_len = local_mbtowc (&wc, p, limit - p); if (char_len == -1) { - warning ("Ignoring invalid multibyte character"); + warning ("ignoring invalid multibyte character"); char_len = 1; c = *p++; } diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c index 1d64ea249f8..48fd3b7b209 100644 --- a/gcc/c-typeck.c +++ b/gcc/c-typeck.c @@ -2925,9 +2925,11 @@ build_unary_op (code, xarg, noconvert) if (typecode != POINTER_TYPE && typecode != INTEGER_TYPE && typecode != REAL_TYPE) { - error ("wrong type argument to %s", - code == PREINCREMENT_EXPR || code == POSTINCREMENT_EXPR - ? "increment" : "decrement"); + if (code == PREINCREMENT_EXPR || code == POSTINCREMENT_EXPR) + error ("wrong type argument to increment"); + else + error ("wrong type argument to decrement"); + return error_mark_node; } @@ -2945,15 +2947,22 @@ build_unary_op (code, xarg, noconvert) /* If pointer target is an undefined struct, we just cannot know how to do the arithmetic. */ if (!COMPLETE_OR_VOID_TYPE_P (TREE_TYPE (result_type))) - error ("%s of pointer to unknown structure", - code == PREINCREMENT_EXPR || code == POSTINCREMENT_EXPR - ? "increment" : "decrement"); + { + if (code == PREINCREMENT_EXPR || code == POSTINCREMENT_EXPR) + error ("increment of pointer to unknown structure"); + else + error ("decrement of pointer to unknown structure"); + } else if ((pedantic || warn_pointer_arith) && (TREE_CODE (TREE_TYPE (result_type)) == FUNCTION_TYPE || TREE_CODE (TREE_TYPE (result_type)) == VOID_TYPE)) - pedwarn ("wrong type argument to %s", - code == PREINCREMENT_EXPR || code == POSTINCREMENT_EXPR - ? "increment" : "decrement"); + { + if (code == PREINCREMENT_EXPR || code == POSTINCREMENT_EXPR) + pedwarn ("wrong type argument to increment"); + else + pedwarn ("wrong type argument to decrement"); + } + inc = c_size_in_bytes (TREE_TYPE (result_type)); } else @@ -3024,7 +3033,7 @@ build_unary_op (code, xarg, noconvert) readonly_warning (arg, ((code == PREINCREMENT_EXPR || code == POSTINCREMENT_EXPR) - ? "increment" : "decrement")); + ? _("increment") : _("decrement"))); if (TREE_CODE (TREE_TYPE (arg)) == BOOLEAN_TYPE) val = boolean_increment (code, arg); |