From 93964ebd2fec8d9e2132e118b02f93bea074ebd2 Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Mon, 11 Mar 2019 14:59:04 +0100 Subject: [PATCH] Wrap apostrophes in gcc internal format with %'. 2019-03-11 Martin Liska * check-internal-format-escaping.py: Uncomment apostrophes check. 2019-03-11 Martin Liska * collect-utils.c (collect_wait): Wrap apostrophes in gcc internal format with %'. * collect2.c (main): Likewise. (scan_prog_file): Likewise. (scan_libraries): Likewise. * config/i386/i386.c (ix86_expand_call): Likewise. (ix86_handle_interrupt_attribute): Likewise. * config/nds32/nds32-intrinsic.c (nds32_expand_builtin_impl): Likewise. * config/nds32/nds32.c (nds32_insert_attributes): Likewise. * config/rl78/rl78.c (rl78_handle_saddr_attribute): Likewise. * lto-wrapper.c (find_crtoffloadtable): Likewise. * symtab.c (symtab_node::verify_base): Likewise. * tree-cfg.c (verify_gimple_label): Likewise. * tree.c (verify_type_variant): Likewise. 2019-03-11 Martin Liska * c-opts.c (c_common_post_options): Wrap apostrophes in gcc internal format with %'. 2019-03-11 Martin Liska * cvt.c (build_expr_type_conversion): Wrap apostrophes in gcc internal format with %'. * decl.c (check_no_redeclaration_friend_default_args): Likewise. (grokfndecl): Likewise. * name-lookup.c (do_pushtag): Likewise. * pt.c (unify_parameter_deduction_failure): Likewise. (unify_template_deduction_failure): Likewise. From-SVN: r269587 --- contrib/ChangeLog | 5 +++++ contrib/check-internal-format-escaping.py | 4 ++-- gcc/ChangeLog | 17 +++++++++++++++++ gcc/c-family/ChangeLog | 5 +++++ gcc/c-family/c-opts.c | 2 +- gcc/collect-utils.c | 2 +- gcc/collect2.c | 6 +++--- gcc/config/i386/i386.c | 6 +++--- gcc/config/nds32/nds32-intrinsic.c | 8 ++++---- gcc/config/nds32/nds32.c | 2 +- gcc/config/rl78/rl78.c | 2 +- gcc/cp/ChangeLog | 10 ++++++++++ gcc/cp/cvt.c | 2 +- gcc/cp/decl.c | 4 ++-- gcc/cp/name-lookup.c | 2 +- gcc/cp/pt.c | 4 ++-- gcc/lto-wrapper.c | 2 +- gcc/symtab.c | 8 ++++---- gcc/tree-cfg.c | 2 +- gcc/tree.c | 16 ++++++++-------- 20 files changed, 73 insertions(+), 36 deletions(-) diff --git a/contrib/ChangeLog b/contrib/ChangeLog index cd5a983ee7d..74e9592f8c2 100644 --- a/contrib/ChangeLog +++ b/contrib/ChangeLog @@ -1,3 +1,8 @@ +2019-03-11 Martin Liska + + * check-internal-format-escaping.py: Uncomment apostrophes + check. + 2019-03-11 Martin Liska * check-internal-format-escaping.py: New file. diff --git a/contrib/check-internal-format-escaping.py b/contrib/check-internal-format-escaping.py index 5513b762271..5da56b59dd6 100755 --- a/contrib/check-internal-format-escaping.py +++ b/contrib/check-internal-format-escaping.py @@ -56,8 +56,8 @@ for i, l in enumerate(lines): print('%s: %s' % (origin, text)) elif p.startswith('__builtin_'): print('%s: %s' % (origin, text)) -# if re.search("[a-zA-Z]'[a-zA-Z]", p): -# print('%s: %s' % (origin, text)) + if re.search("[a-zA-Z]'[a-zA-Z]", p): + print('%s: %s' % (origin, text)) j += 1 origin = None diff --git a/gcc/ChangeLog b/gcc/ChangeLog index dd070969d64..61e23a645b1 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,20 @@ +2019-03-11 Martin Liska + + * collect-utils.c (collect_wait): Wrap apostrophes + in gcc internal format with %'. + * collect2.c (main): Likewise. + (scan_prog_file): Likewise. + (scan_libraries): Likewise. + * config/i386/i386.c (ix86_expand_call): Likewise. + (ix86_handle_interrupt_attribute): Likewise. + * config/nds32/nds32-intrinsic.c (nds32_expand_builtin_impl): Likewise. + * config/nds32/nds32.c (nds32_insert_attributes): Likewise. + * config/rl78/rl78.c (rl78_handle_saddr_attribute): Likewise. + * lto-wrapper.c (find_crtoffloadtable): Likewise. + * symtab.c (symtab_node::verify_base): Likewise. + * tree-cfg.c (verify_gimple_label): Likewise. + * tree.c (verify_type_variant): Likewise. + 2019-03-11 Martin Liska * builtins.c (expand_builtin_thread_pointer): Wrap an option name diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index e529538d8ff..885e3265d5b 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,3 +1,8 @@ +2019-03-11 Martin Liska + + * c-opts.c (c_common_post_options): Wrap apostrophes + in gcc internal format with %'. + 2019-03-11 Martin Liska * c-attribs.c (handle_nocf_check_attribute): Wrap an option name diff --git a/gcc/c-family/c-opts.c b/gcc/c-family/c-opts.c index 3233fdb9775..daa02a5e72d 100644 --- a/gcc/c-family/c-opts.c +++ b/gcc/c-family/c-opts.c @@ -945,7 +945,7 @@ c_common_post_options (const char **pfilename) if (flag_abi_version == latest_abi_version) { auto_diagnostic_group d; - if (warning (OPT_Wabi, "%<-Wabi%> won't warn about anything")) + if (warning (OPT_Wabi, "%<-Wabi%> won%'t warn about anything")) { inform (input_location, "%<-Wabi%> warns about differences " "from the most up-to-date ABI, which is also used " diff --git a/gcc/collect-utils.c b/gcc/collect-utils.c index fba3f7496ef..1e034433b80 100644 --- a/gcc/collect-utils.c +++ b/gcc/collect-utils.c @@ -65,7 +65,7 @@ collect_wait (const char *prog, struct pex_obj *pex) int status; if (!pex_get_status (pex, 1, &status)) - fatal_error (input_location, "can't get program status: %m"); + fatal_error (input_location, "can%'t get program status: %m"); pex_free (pex); if (response_file && !save_temps) diff --git a/gcc/collect2.c b/gcc/collect2.c index da956bfd984..9d7de940ec1 100644 --- a/gcc/collect2.c +++ b/gcc/collect2.c @@ -1396,7 +1396,7 @@ main (int argc, char **argv) stream = fopen (list_filename, "r"); if (stream == NULL) - fatal_error (input_location, "can't open %s: %m", + fatal_error (input_location, "can%'t open %s: %m", list_filename); while (fgets (buf, sizeof buf, stream) != NULL) @@ -2470,7 +2470,7 @@ scan_prog_file (const char *prog_name, scanpass which_pass, inf = pex_read_output (pex, 0); if (inf == NULL) - fatal_error (input_location, "can't open nm output: %m"); + fatal_error (input_location, "can%'t open nm output: %m"); if (debug) fprintf (stderr, "\nnm output with constructors/destructors.\n"); @@ -2639,7 +2639,7 @@ scan_libraries (const char *prog_name) inf = pex_read_output (pex, 0); if (inf == NULL) - fatal_error (input_location, "can't open ldd output: %m"); + fatal_error (input_location, "can%'t open ldd output: %m"); if (debug) notice ("\nldd output with constructors/destructors.\n"); diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index a4a7fbcfbe0..896c6f33d40 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -28399,7 +28399,7 @@ ix86_expand_call (rtx retval, rtx fnaddr, rtx callarg1, if (fndecl && (lookup_attribute ("interrupt", TYPE_ATTRIBUTES (TREE_TYPE (fndecl))))) - error ("interrupt service routine can't be called directly"); + error ("interrupt service routine can%'t be called directly"); } else fndecl = NULL_TREE; @@ -38375,7 +38375,7 @@ rdseed_step: mode0 = insn_data[icode].operand[0].mode; if (!insn_data[icode].operand[0].predicate (op0, mode0)) { - error ("the xabort's argument must be an 8-bit immediate"); + error ("xabort argument must be an 8-bit immediate"); return const0_rtx; } emit_insn (gen_xabort (op0)); @@ -41440,7 +41440,7 @@ ix86_handle_interrupt_attribute (tree *node, tree, tree, int, bool *) error ("interrupt service routine can only have a pointer argument " "and an optional integer argument"); if (! VOID_TYPE_P (return_type)) - error ("interrupt service routine can't have non-void return value"); + error ("interrupt service routine can%'t have non-void return value"); return NULL_TREE; } diff --git a/gcc/config/nds32/nds32-intrinsic.c b/gcc/config/nds32/nds32-intrinsic.c index 04aa29095d7..c78dc935bf3 100644 --- a/gcc/config/nds32/nds32-intrinsic.c +++ b/gcc/config/nds32/nds32-intrinsic.c @@ -1000,7 +1000,7 @@ nds32_expand_builtin_impl (tree exp, if (!NDS32_EXT_DSP_P () && fcode > NDS32_BUILTIN_DSP_BEGIN && fcode < NDS32_BUILTIN_DSP_END) - error ("don't support DSP extension instructions"); + error ("don%'t support DSP extension instructions"); switch (fcode) { @@ -1059,7 +1059,7 @@ nds32_expand_builtin_impl (tree exp, case NDS32_BUILTIN_CLO: if (!TARGET_EXT_PERF) { - error ("don't support performance extension instructions"); + error ("don%'t support performance extension instructions"); return NULL_RTX; } break; @@ -1071,7 +1071,7 @@ nds32_expand_builtin_impl (tree exp, case NDS32_BUILTIN_BSP: if (!TARGET_EXT_PERF2) { - error ("don't support performance extension " + error ("don%'t support performance extension " "version 2 instructions"); return NULL_RTX; } @@ -1083,7 +1083,7 @@ nds32_expand_builtin_impl (tree exp, case NDS32_BUILTIN_FLMISM: if (!TARGET_EXT_STRING) { - error ("don't support string extension instructions"); + error ("don%'t support string extension instructions"); return NULL_RTX; } break; diff --git a/gcc/config/nds32/nds32.c b/gcc/config/nds32/nds32.c index 8bee154a429..f2723ea4cdc 100644 --- a/gcc/config/nds32/nds32.c +++ b/gcc/config/nds32/nds32.c @@ -3944,7 +3944,7 @@ nds32_insert_attributes (tree decl, tree *attributes) new_attrs = tree_cons (get_identifier ("noclone"), NULL, new_attrs); if (!TREE_PUBLIC (decl)) - error("indirect_call attribute can't apply for static function"); + error ("indirect_call attribute can%'t apply for static function"); *attributes = new_attrs; } diff --git a/gcc/config/rl78/rl78.c b/gcc/config/rl78/rl78.c index c127c506570..d2caa118281 100644 --- a/gcc/config/rl78/rl78.c +++ b/gcc/config/rl78/rl78.c @@ -864,7 +864,7 @@ rl78_handle_saddr_attribute (tree * node, if (TREE_CODE (* node) == FUNCTION_DECL) { - warning (OPT_Wattributes, "%qE attribute doesn't apply to functions", + warning (OPT_Wattributes, "%qE attribute doesn%'t apply to functions", name); * no_add_attrs = true; } diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index fd983475384..8cad038fd1c 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,13 @@ +2019-03-11 Martin Liska + + * cvt.c (build_expr_type_conversion): Wrap apostrophes + in gcc internal format with %'. + * decl.c (check_no_redeclaration_friend_default_args): Likewise. + (grokfndecl): Likewise. + * name-lookup.c (do_pushtag): Likewise. + * pt.c (unify_parameter_deduction_failure): Likewise. + (unify_template_deduction_failure): Likewise. + 2019-03-11 Martin Liska * call.c (convert_arg_to_ellipsis): Wrap an option name diff --git a/gcc/cp/cvt.c b/gcc/cp/cvt.c index c10db92bd6f..3b8656c2a6b 100644 --- a/gcc/cp/cvt.c +++ b/gcc/cp/cvt.c @@ -1822,7 +1822,7 @@ build_expr_type_conversion (int desires, tree expr, bool complain) if (TREE_CODE (cand) == TEMPLATE_DECL) { if (complain) - error ("default type conversion can't deduce template" + error ("default type conversion can%'t deduce template" " argument for %qD", cand); return error_mark_node; } diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 89edfe8ed01..c8435e29491 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -1305,7 +1305,7 @@ check_no_redeclaration_friend_default_args (tree olddecl, tree newdecl, auto_diagnostic_group d; if (permerror (DECL_SOURCE_LOCATION (newdecl), "friend declaration of %q#D specifies default " - "arguments and isn't the only declaration", newdecl)) + "arguments and isn%'t the only declaration", newdecl)) inform (DECL_SOURCE_LOCATION (olddecl), "previous declaration of %q#D", olddecl); return; @@ -8913,7 +8913,7 @@ grokfndecl (tree ctype, { permerror (DECL_SOURCE_LOCATION (decl), "friend declaration of %qD specifies default " - "arguments and isn't a definition", decl); + "arguments and isn%'t a definition", decl); break; } } diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c index 2ba888fd1c2..4ca976c812d 100644 --- a/gcc/cp/name-lookup.c +++ b/gcc/cp/name-lookup.c @@ -6897,7 +6897,7 @@ do_pushtag (tree name, tree type, tag_scope scope) && !CLASSTYPE_TEMPLATE_INFO (type)) { error ("declaration of % does not match " - "%<#include %>, isn't a template"); + "%<#include %>, isn%'t a template"); return error_mark_node; } } diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index f48f4605b0f..2ab6e273c3a 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -6364,7 +6364,7 @@ unify_parameter_deduction_failure (bool explain_p, tree parm) { if (explain_p) inform (input_location, - " couldn't deduce template parameter %qD", parm); + " couldn%'t deduce template parameter %qD", parm); return unify_invalid (explain_p); } @@ -6540,7 +6540,7 @@ unify_template_deduction_failure (bool explain_p, tree parm, tree arg) { if (explain_p) inform (input_location, - " can't deduce a template for %qT from non-template type %qT", + " can%'t deduce a template for %qT from non-template type %qT", parm, arg); return unify_invalid (explain_p); } diff --git a/gcc/lto-wrapper.c b/gcc/lto-wrapper.c index c079c7b7161..2cd69f24048 100644 --- a/gcc/lto-wrapper.c +++ b/gcc/lto-wrapper.c @@ -960,7 +960,7 @@ find_crtoffloadtable (void) } if (i == n_paths) fatal_error (input_location, - "installation error, can't find crtoffloadtable.o"); + "installation error, can%'t find crtoffloadtable.o"); free_array_of_ptrs ((void **) paths, n_paths); } diff --git a/gcc/symtab.c b/gcc/symtab.c index 16a21359f8d..c3c057d3283 100644 --- a/gcc/symtab.c +++ b/gcc/symtab.c @@ -1155,7 +1155,7 @@ symtab_node::verify_base (void) } if (implicit_section && !get_section ()) { - error ("implicit_section flag is set but section isn't"); + error ("implicit_section flag is set but section isn%'t"); error_found = true; } if (get_section () && get_comdat_group () @@ -1174,14 +1174,14 @@ symtab_node::verify_base (void) || strcmp (get_section(), get_alias_target ()->get_section ()))) { - error ("Alias and target's section differs"); + error ("Alias and target%'s section differs"); get_alias_target ()->dump (stderr); error_found = true; } if (alias && definition && get_comdat_group () != get_alias_target ()->get_comdat_group ()) { - error ("Alias and target's comdat groups differs"); + error ("Alias and target%'s comdat groups differs"); get_alias_target ()->dump (stderr); error_found = true; } @@ -1196,7 +1196,7 @@ symtab_node::verify_base (void) ultimate_transparent_alias_target (DECL_ASSEMBLER_NAME (to->decl))); if (!symbol_table::assembler_names_equal_p (name1, name2)) { - error ("Transparent alias and target's assembler names differs"); + error ("Transparent alias and target%'s assembler names differs"); get_alias_target ()->dump (stderr); error_found = true; } diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c index c8d6d1b12a9..805e8727ce0 100644 --- a/gcc/tree-cfg.c +++ b/gcc/tree-cfg.c @@ -4827,7 +4827,7 @@ verify_gimple_label (glabel *stmt) if (!DECL_NONLOCAL (decl) && !FORCED_LABEL (decl) && DECL_CONTEXT (decl) != current_function_decl) { - error ("label's context is not the current function decl"); + error ("label%'s context is not the current function decl"); err |= true; } diff --git a/gcc/tree.c b/gcc/tree.c index 6528057524c..02721cfc8a0 100644 --- a/gcc/tree.c +++ b/gcc/tree.c @@ -13815,9 +13815,9 @@ verify_type_variant (const_tree t, tree tv) TYPE_SIZE_UNIT (tv), 0)); error ("type variant has different TYPE_SIZE_UNIT"); debug_tree (tv); - error ("type variant's TYPE_SIZE_UNIT"); + error ("type variant%'s TYPE_SIZE_UNIT"); debug_tree (TYPE_SIZE_UNIT (tv)); - error ("type's TYPE_SIZE_UNIT"); + error ("type%'s TYPE_SIZE_UNIT"); debug_tree (TYPE_SIZE_UNIT (t)); return false; } @@ -13888,9 +13888,9 @@ verify_type_variant (const_tree t, tree tv) { error ("type variant has different TYPE_BINFO"); debug_tree (tv); - error ("type variant's TYPE_BINFO"); + error ("type variant%'s TYPE_BINFO"); debug_tree (TYPE_BINFO (tv)); - error ("type's TYPE_BINFO"); + error ("type%'s TYPE_BINFO"); debug_tree (TYPE_BINFO (t)); return false; } @@ -13952,9 +13952,9 @@ verify_type_variant (const_tree t, tree tv) { error ("type variant has different TREE_TYPE"); debug_tree (tv); - error ("type variant's TREE_TYPE"); + error ("type variant%'s TREE_TYPE"); debug_tree (TREE_TYPE (tv)); - error ("type's TREE_TYPE"); + error ("type%'s TREE_TYPE"); debug_tree (TREE_TYPE (t)); return false; } @@ -13963,9 +13963,9 @@ verify_type_variant (const_tree t, tree tv) { error ("type is not compatible with its variant"); debug_tree (tv); - error ("type variant's TREE_TYPE"); + error ("type variant%'s TREE_TYPE"); debug_tree (TREE_TYPE (tv)); - error ("type's TREE_TYPE"); + error ("type%'s TREE_TYPE"); debug_tree (TREE_TYPE (t)); return false; } -- 2.30.2