From 324ff1a07f9ddde87f91acfa7b16a3c24ba6895c Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Tue, 28 Feb 2017 16:25:19 +0100 Subject: [PATCH] i386.c: Include intl.h. * config/i386/i386.c: Include intl.h. (ix86_option_override_internal): Use cond ? G_("...") : G_("...") instead of just cond ? "..." : "...". * config/nvptx/nvptx.c (nvptx_goacc_validate_dims): Likewise. * coverage.c (read_counts_file): Likewise. * omp-offload.c: Include intl.h. (oacc_loop_fixed_partitions): Use cond ? G_("...") : G_("...") instead of just cond ? "..." : "...". * gcov.c (read_count_file): Use cond ? N_("...") : N_("...") instead of just cond ? "..." : "...". c/ * c-parser.c (c_parser_asm_statement): Use cond ? G_("...") : G_("...") instead of just cond ? "..." : "...". (c_parser_oacc_enter_exit_data): Use %s and ternary operator only for "enter"/"exit" keyword. (c_finish_oacc_routine): Don't use %s to supply portions of the message. cp/ * decl.c (find_decomp_class_base): Use cond ? G_("...") : G_("...") instead of just cond ? "..." : "...". (grokdeclarator): Likewise. (build_enumerator): Likewise. * init.c (build_new_1): Likewise. * call.c (build_new_method_call_1): Likewise. * parser.c: Include intl.h. (cp_parser_oacc_enter_exit_data): Use %s and ternary operator only for "enter"/"exit" keyword. (cp_finalize_oacc_routine): Don't use %s to supply portions of the message. fortran/ * parse.c (parse_critical_block): Use cond ? G_("...") : G_("...") instead of just cond ? "..." : "...". * scanner.c (gfc_next_char_literal): Likewise. * match.c (match_exit_cycle): Likewise. From-SVN: r245778 --- gcc/ChangeLog | 13 ++++++ gcc/c/ChangeLog | 9 +++++ gcc/c/c-parser.c | 21 +++++----- gcc/config/i386/i386.c | 86 +++++++++++++++++++++------------------- gcc/config/nvptx/nvptx.c | 4 +- gcc/coverage.c | 4 +- gcc/cp/ChangeLog | 14 +++++++ gcc/cp/call.c | 4 +- gcc/cp/decl.c | 16 ++++---- gcc/cp/init.c | 4 +- gcc/cp/parser.c | 11 ++--- gcc/fortran/ChangeLog | 7 ++++ gcc/fortran/match.c | 4 +- gcc/fortran/parse.c | 4 +- gcc/fortran/scanner.c | 18 +++++---- gcc/gcov.c | 5 ++- gcc/omp-offload.c | 7 ++-- 17 files changed, 146 insertions(+), 85 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ccbe5a3d612..87478eec431 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,16 @@ +2017-02-28 Jakub Jelinek + + * config/i386/i386.c: Include intl.h. + (ix86_option_override_internal): Use cond ? G_("...") : G_("...") + instead of just cond ? "..." : "...". + * config/nvptx/nvptx.c (nvptx_goacc_validate_dims): Likewise. + * coverage.c (read_counts_file): Likewise. + * omp-offload.c: Include intl.h. + (oacc_loop_fixed_partitions): Use cond ? G_("...") : G_("...") instead + of just cond ? "..." : "...". + * gcov.c (read_count_file): Use cond ? N_("...") : N_("...") instead + of just cond ? "..." : "...". + 2017-02-28 Richard Earnshaw PR target/79742 diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog index 699def022f0..95cea175d3f 100644 --- a/gcc/c/ChangeLog +++ b/gcc/c/ChangeLog @@ -1,3 +1,12 @@ +2017-02-28 Jakub Jelinek + + * c-parser.c (c_parser_asm_statement): Use cond ? G_("...") : G_("...") + instead of just cond ? "..." : "...". + (c_parser_oacc_enter_exit_data): Use %s and ternary operator only + for "enter"/"exit" keyword. + (c_finish_oacc_routine): Don't use %s to supply portions of the + message. + 2017-02-24 Jakub Jelinek PR c++/79588 diff --git a/gcc/c/c-parser.c b/gcc/c/c-parser.c index 34585b912e6..c74b3cff001 100644 --- a/gcc/c/c-parser.c +++ b/gcc/c/c-parser.c @@ -64,6 +64,7 @@ along with GCC; see the file COPYING3. If not see #include "gimple-parser.h" #include "read-rtl-function.h" #include "run-rtl-passes.h" +#include "intl.h" /* We need to walk over decls with incomplete struct/union/enum types after parsing the whole translation unit. @@ -6159,8 +6160,8 @@ c_parser_asm_statement (c_parser *parser) { if (!c_parser_require (parser, CPP_COLON, is_goto - ? "expected %<:%>" - : "expected %<:%> or %<)%>")) + ? G_("expected %<:%>") + : G_("expected %<:%> or %<)%>"))) goto error_close_paren; /* Once past any colon, we're no longer a simple asm. */ @@ -13925,9 +13926,8 @@ c_parser_oacc_enter_exit_data (c_parser *parser, bool enter) if (strcmp (p, "data") != 0) { - error_at (loc, enter - ? "expected % after %<#pragma acc enter%>" - : "expected % after %<#pragma acc exit%>"); + error_at (loc, "expected % after %<#pragma acc %s%>", + enter ? "enter" : "exit"); parser->error = true; c_parser_skip_to_pragma_eol (parser); return; @@ -13942,9 +13942,8 @@ c_parser_oacc_enter_exit_data (c_parser *parser, bool enter) if (omp_find_clause (clauses, OMP_CLAUSE_MAP) == NULL_TREE) { - error_at (loc, enter - ? "%<#pragma acc enter data%> has no data movement clause" - : "%<#pragma acc exit data%> has no data movement clause"); + error_at (loc, "%<#pragma acc %s data%> has no data movement clause", + enter ? "enter" : "exit"); return; } @@ -14270,8 +14269,10 @@ c_finish_oacc_routine (struct oacc_routine_data *data, tree fndecl, if (TREE_USED (fndecl) || (!is_defn && DECL_SAVED_TREE (fndecl))) { error_at (data->loc, - "%<#pragma acc routine%> must be applied before %s", - TREE_USED (fndecl) ? "use" : "definition"); + TREE_USED (fndecl) + ? G_("%<#pragma acc routine%> must be applied before use") + : G_("%<#pragma acc routine%> must be applied before " + "definition")); data->error_seen = true; return; } diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 14ac189fc42..33ad0f1f0ec 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -83,6 +83,7 @@ along with GCC; see the file COPYING3. If not see #include "selftest.h" #include "selftest-rtl.h" #include "print-rtl.h" +#include "intl.h" /* This file should be included last. */ #include "target-def.h" @@ -5265,11 +5266,11 @@ ix86_option_override_internal (bool main_args_p, else if (!strcmp (opts->x_ix86_tune_string, "x86-64")) warning (OPT_Wdeprecated, main_args_p - ? "%<-mtune=x86-64%> is deprecated; use %<-mtune=k8%> " - "or %<-mtune=generic%> instead as appropriate" - : "% is deprecated; use " - "% or % " - "instead as appropriate"); + ? G_("%<-mtune=x86-64%> is deprecated; use %<-mtune=k8%> " + "or %<-mtune=generic%> instead as appropriate") + : G_("% is deprecated; use " + "% or %" + " instead as appropriate")); } else { @@ -5418,17 +5419,19 @@ ix86_option_override_internal (bool main_args_p, if (!strcmp (opts->x_ix86_arch_string, "generic")) { error (main_args_p - ? "% CPU can be used only for %<-mtune=%> switch" - : "% CPU can be used only for " - "% attribute"); + ? G_("% CPU can be used only for %<-mtune=%> " + "switch") + : G_("% CPU can be used only for " + "% attribute")); return false; } else if (!strcmp (opts->x_ix86_arch_string, "intel")) { error (main_args_p - ? "% CPU can be used only for %<-mtune=%> switch" - : "% CPU can be used only for " - "% attribute"); + ? G_("% CPU can be used only for %<-mtune=%> " + "switch") + : G_("% CPU can be used only for " + "% attribute")); return false; } @@ -5656,8 +5659,8 @@ ix86_option_override_internal (bool main_args_p, if (i == pta_size) { error (main_args_p - ? "bad value (%qs) for %<-march=%> switch" - : "bad value (%qs) for % attribute", + ? G_("bad value (%qs) for %<-march=%> switch") + : G_("bad value (%qs) for % attribute"), opts->x_ix86_arch_string); auto_vec candidates; @@ -5674,16 +5677,16 @@ ix86_option_override_internal (bool main_args_p, if (hint) inform (input_location, main_args_p - ? "valid arguments to %<-march=%> switch are: " - "%s; did you mean %qs?" - : "valid arguments to % attribute are: " - "%s; did you mean %qs?", s, hint); + ? G_("valid arguments to %<-march=%> switch are: " + "%s; did you mean %qs?") + : G_("valid arguments to % attribute are: " + "%s; did you mean %qs?"), s, hint); else inform (input_location, main_args_p - ? "valid arguments to %<-march=%> switch are: %s" - : "valid arguments to % attribute are: %s", - s); + ? G_("valid arguments to %<-march=%> switch are: %s") + : G_("valid arguments to % attribute " + "are: %s"), s); XDELETEVEC (s); } @@ -5729,8 +5732,8 @@ ix86_option_override_internal (bool main_args_p, if (ix86_tune_specified && i == pta_size) { error (main_args_p - ? "bad value (%qs) for %<-mtune=%> switch" - : "bad value (%qs) for % attribute", + ? G_("bad value (%qs) for %<-mtune=%> switch") + : G_("bad value (%qs) for % attribute"), opts->x_ix86_tune_string); auto_vec candidates; @@ -5745,16 +5748,16 @@ ix86_option_override_internal (bool main_args_p, if (hint) inform (input_location, main_args_p - ? "valid arguments to %<-mtune=%> switch are: " - "%s; did you mean %qs?" - : "valid arguments to % attribute are: " - "%s; did you mean %qs?", s, hint); + ? G_("valid arguments to %<-mtune=%> switch are: " + "%s; did you mean %qs?") + : G_("valid arguments to % attribute are: " + "%s; did you mean %qs?"), s, hint); else inform (input_location, main_args_p - ? "valid arguments to %<-mtune=%> switch are: %s" - : "valid arguments to % attribute are: %s", - s); + ? G_("valid arguments to %<-mtune=%> switch are: %s") + : G_("valid arguments to % attribute " + "are: %s"), s); XDELETEVEC (s); } @@ -5856,8 +5859,9 @@ ix86_option_override_internal (bool main_args_p, if (TARGET_RTD_P (opts->x_target_flags)) warning (0, - main_args_p ? "%<-mrtd%> is ignored in 64bit mode" - : "% is ignored in 64bit mode"); + main_args_p + ? G_("%<-mrtd%> is ignored in 64bit mode") + : G_("% is ignored in 64bit mode")); } else { @@ -5979,8 +5983,8 @@ ix86_option_override_internal (bool main_args_p, if (TARGET_SSEREGPARM_P (opts->x_target_flags) && ! TARGET_SSE_P (opts->x_ix86_isa_flags)) error (main_args_p - ? "%<-msseregparm%> used without SSE enabled" - : "% used without SSE enabled"); + ? G_("%<-msseregparm%> used without SSE enabled") + : G_("% used without SSE enabled")); if (opts_set->x_ix86_fpmath) { @@ -6047,10 +6051,11 @@ ix86_option_override_internal (bool main_args_p, if (opts_set->x_target_flags & MASK_ACCUMULATE_OUTGOING_ARGS) warning (0, main_args_p - ? "stack probing requires %<-maccumulate-outgoing-args%> " - "for correctness" - : "stack probing requires " - "% for correctness"); + ? G_("stack probing requires %<-maccumulate-outgoing-args%> " + "for correctness") + : G_("stack probing requires " + "% for " + "correctness")); opts->x_target_flags |= MASK_ACCUMULATE_OUTGOING_ARGS; } @@ -6062,9 +6067,10 @@ ix86_option_override_internal (bool main_args_p, if (opts_set->x_target_flags & MASK_ACCUMULATE_OUTGOING_ARGS) warning (0, main_args_p - ? "fixed ebp register requires %<-maccumulate-outgoing-args%>" - : "fixed ebp register requires " - "%"); + ? G_("fixed ebp register requires " + "%<-maccumulate-outgoing-args%>") + : G_("fixed ebp register requires " + "%")); opts->x_target_flags |= MASK_ACCUMULATE_OUTGOING_ARGS; } diff --git a/gcc/config/nvptx/nvptx.c b/gcc/config/nvptx/nvptx.c index c52b090c910..b6899221eb3 100644 --- a/gcc/config/nvptx/nvptx.c +++ b/gcc/config/nvptx/nvptx.c @@ -4542,8 +4542,8 @@ nvptx_goacc_validate_dims (tree decl, int dims[], int fn_level) if (fn_level < 0 && dims[GOMP_DIM_VECTOR] >= 0) warning_at (decl ? DECL_SOURCE_LOCATION (decl) : UNKNOWN_LOCATION, 0, dims[GOMP_DIM_VECTOR] - ? "using vector_length (%d), ignoring %d" - : "using vector_length (%d), ignoring runtime setting", + ? G_("using vector_length (%d), ignoring %d") + : G_("using vector_length (%d), ignoring runtime setting"), PTX_VECTOR_LENGTH, dims[GOMP_DIM_VECTOR]); dims[GOMP_DIM_VECTOR] = PTX_VECTOR_LENGTH; changed = true; diff --git a/gcc/coverage.c b/gcc/coverage.c index cb9841d3769..0a949c3a9f7 100644 --- a/gcc/coverage.c +++ b/gcc/coverage.c @@ -327,7 +327,9 @@ read_counts_file (void) gcov_sync (offset, length); if ((is_error = gcov_is_error ())) { - error (is_error < 0 ? "%qs has overflowed" : "%qs is corrupted", + error (is_error < 0 + ? G_("%qs has overflowed") + : G_("%qs is corrupted"), da_file_name); delete counts_hash; counts_hash = NULL; diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 5792e5d08d0..e62bdb3420c 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,17 @@ +2017-02-28 Jakub Jelinek + + * decl.c (find_decomp_class_base): Use cond ? G_("...") : G_("...") + instead of just cond ? "..." : "...". + (grokdeclarator): Likewise. + (build_enumerator): Likewise. + * init.c (build_new_1): Likewise. + * call.c (build_new_method_call_1): Likewise. + * parser.c: Include intl.h. + (cp_parser_oacc_enter_exit_data): Use %s and ternary operator only for + "enter"/"exit" keyword. + (cp_finalize_oacc_routine): Don't use %s to supply portions of the + message. + 2017-02-27 Jason Merrill PR c++/71568 - SFINAE forming pointer to member function diff --git a/gcc/cp/call.c b/gcc/cp/call.c index dd09049f452..560804ab2d5 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -8772,8 +8772,8 @@ build_new_method_call_1 (tree instance, tree fns, vec **args, else if (DECL_CONSTRUCTOR_P (current_function_decl) || DECL_DESTRUCTOR_P (current_function_decl)) warning (0, (DECL_CONSTRUCTOR_P (current_function_decl) - ? "pure virtual %q#D called from constructor" - : "pure virtual %q#D called from destructor"), + ? G_("pure virtual %q#D called from constructor") + : G_("pure virtual %q#D called from destructor")), fn); } diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 828359f7171..54cbbb70c01 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -7224,8 +7224,9 @@ find_decomp_class_base (location_t loc, tree type, tree ret) error_at (loc, "cannot decompose non-public member %qD of %qT", field, type); inform (DECL_SOURCE_LOCATION (field), - TREE_PRIVATE (field) ? "declared private here" - : "declared protected here"); + TREE_PRIVATE (field) + ? G_("declared private here") + : G_("declared protected here")); return error_mark_node; } else @@ -11001,8 +11002,8 @@ grokdeclarator (const cp_declarator *declarator, { maybe_warn_cpp0x (CPP0X_REF_QUALIFIER); error ((flags == DTOR_FLAG) - ? "destructors may not be ref-qualified" - : "constructors may not be ref-qualified"); + ? G_("destructors may not be ref-qualified") + : G_("constructors may not be ref-qualified")); rqual = REF_QUAL_NONE; } @@ -14484,9 +14485,10 @@ build_enumerator (tree name, tree value, tree enumtype, tree attributes, } if (type && cxx_dialect < cxx11 && itk > itk_unsigned_long) - pedwarn (input_location, OPT_Wlong_long, pos ? "\ -incremented enumerator value is too large for %" : "\ -incremented enumerator value is too large for %"); + pedwarn (input_location, OPT_Wlong_long, + pos ? G_("\ +incremented enumerator value is too large for %") : G_("\ +incremented enumerator value is too large for %")); } if (type == NULL_TREE) overflowed = true; diff --git a/gcc/cp/init.c b/gcc/cp/init.c index 99eeb8a893f..55209634147 100644 --- a/gcc/cp/init.c +++ b/gcc/cp/init.c @@ -2811,8 +2811,8 @@ build_new_1 (vec **placement, tree type, tree nelts, { pedwarn (EXPR_LOC_OR_LOC (outer_nelts, input_location), OPT_Wvla, typedef_variant_p (orig_type) - ? "non-constant array new length must be specified " - "directly, not by typedef" + ? G_("non-constant array new length must be specified " + "directly, not by typedef") : G_("non-constant array new length must be specified " "without parentheses around the type-id")); } diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index 65feca3ee99..50528e24335 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -36293,9 +36293,8 @@ cp_parser_oacc_enter_exit_data (cp_parser *parser, cp_token *pragma_tok, if (strcmp (p, "data") != 0) { - error_at (loc, enter - ? "expected % after %<#pragma acc enter%>" - : "expected % after %<#pragma acc exit%>"); + error_at (loc, "expected % after %<#pragma acc %s%>", + enter ? "enter" : "exit"); cp_parser_skip_to_pragma_eol (parser, pragma_tok); return NULL_TREE; } @@ -37573,8 +37572,10 @@ cp_finalize_oacc_routine (cp_parser *parser, tree fndecl, bool is_defn) if (TREE_USED (fndecl) || (!is_defn && DECL_SAVED_TREE (fndecl))) { error_at (parser->oacc_routine->loc, - "%<#pragma acc routine%> must be applied before %s", - TREE_USED (fndecl) ? "use" : "definition"); + TREE_USED (fndecl) + ? G_("%<#pragma acc routine%> must be applied before use") + : G_("%<#pragma acc routine%> must be applied before " + "definition")); parser->oacc_routine = NULL; return; } diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index e3af1c5e943..e9432d2cd91 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,10 @@ +2017-02-28 Jakub Jelinek + + * parse.c (parse_critical_block): Use cond ? G_("...") : G_("...") + instead of just cond ? "..." : "...". + * scanner.c (gfc_next_char_literal): Likewise. + * match.c (match_exit_cycle): Likewise. + 2017-02-26 Thomas Koenig PR fortran/51119 diff --git a/gcc/fortran/match.c b/gcc/fortran/match.c index 003a0434eb0..fc37f227e8a 100644 --- a/gcc/fortran/match.c +++ b/gcc/fortran/match.c @@ -2731,8 +2731,8 @@ match_exit_cycle (gfc_statement st, gfc_exec_op op) if (o != NULL) { gfc_error (is_oacc (p) - ? "%s statement at %C leaving OpenACC structured block" - : "%s statement at %C leaving OpenMP structured block", + ? G_("%s statement at %C leaving OpenACC structured block") + : G_("%s statement at %C leaving OpenMP structured block"), gfc_ascii_statement (st)); return MATCH_ERROR; } diff --git a/gcc/fortran/parse.c b/gcc/fortran/parse.c index 3809ec18556..3c568ee8c83 100644 --- a/gcc/fortran/parse.c +++ b/gcc/fortran/parse.c @@ -4340,8 +4340,8 @@ parse_critical_block (void) for (sd = gfc_state_stack; sd; sd = sd->previous) if (sd->state == COMP_OMP_STRUCTURED_BLOCK) gfc_error_now (is_oacc (sd) - ? "CRITICAL block inside of OpenACC region at %C" - : "CRITICAL block inside of OpenMP region at %C"); + ? G_("CRITICAL block inside of OpenACC region at %C") + : G_("CRITICAL block inside of OpenMP region at %C")); s.ext.end_do_label = new_st.label1; diff --git a/gcc/fortran/scanner.c b/gcc/fortran/scanner.c index 9a0f918b4cc..82f431da527 100644 --- a/gcc/fortran/scanner.c +++ b/gcc/fortran/scanner.c @@ -1406,10 +1406,11 @@ restart: if (i == 4) old_loc = gfc_current_locus; } - gfc_error (is_openmp ? "Wrong OpenACC continuation at %C: " - "expected !$ACC, got !$OMP" - : "Wrong OpenMP continuation at %C: " - "expected !$OMP, got !$ACC"); + gfc_error (is_openmp + ? G_("Wrong OpenACC continuation at %C: " + "expected !$ACC, got !$OMP") + : G_("Wrong OpenMP continuation at %C: " + "expected !$OMP, got !$ACC")); } if (c != '&') @@ -1502,10 +1503,11 @@ restart: if (gfc_wide_tolower (c) != (unsigned char) "*$acc"[i]) is_openmp = 1; } - gfc_error (is_openmp ? "Wrong OpenACC continuation at %C: " - "expected !$ACC, got !$OMP" - : "Wrong OpenMP continuation at %C: " - "expected !$OMP, got !$ACC"); + gfc_error (is_openmp + ? G_("Wrong OpenACC continuation at %C: " + "expected !$ACC, got !$OMP") + : G_("Wrong OpenMP continuation at %C: " + "expected !$OMP, got !$ACC")); } else if (!openmp_flag && !openacc_flag) for (i = 0; i < 5; i++) diff --git a/gcc/gcov.c b/gcc/gcov.c index f1067b4986c..06880c1d182 100644 --- a/gcc/gcov.c +++ b/gcc/gcov.c @@ -1669,7 +1669,10 @@ read_count_file (function_t *fns) gcov_sync (base, length); if ((error = gcov_is_error ())) { - fnotice (stderr, error < 0 ? "%s:overflowed\n" : "%s:corrupted\n", + fnotice (stderr, + error < 0 + ? N_("%s:overflowed\n") + : N_("%s:corrupted\n"), da_file_name); goto cleanup; } diff --git a/gcc/omp-offload.c b/gcc/omp-offload.c index fad038f32e7..520bb91b8bf 100644 --- a/gcc/omp-offload.c +++ b/gcc/omp-offload.c @@ -45,6 +45,7 @@ along with GCC; see the file COPYING3. If not see #include "lto-section-names.h" #include "gomp-constants.h" #include "gimple-pretty-print.h" +#include "intl.h" /* Describe the OpenACC looping structure of a function. The entire function is held in a 'NULL' loop. */ @@ -1117,9 +1118,9 @@ oacc_loop_fixed_partitions (oacc_loop *loop, unsigned outer_mask) if (noisy) error_at (loop->loc, seq_par - ? "% overrides other OpenACC loop specifiers" - : "% conflicts with other OpenACC loop " - "specifiers"); + ? G_("% overrides other OpenACC loop specifiers") + : G_("% conflicts with other OpenACC loop " + "specifiers")); maybe_auto = false; loop->flags &= ~OLF_AUTO; if (seq_par) -- 2.30.2