diff options
author | Martin Sebor <msebor@redhat.com> | 2020-11-25 14:05:01 -0700 |
---|---|---|
committer | Martin Sebor <msebor@redhat.com> | 2020-11-25 15:00:27 -0700 |
commit | ca23341b28cd3af7985b83a6479107d9ea145a90 (patch) | |
tree | abaa791c43dac7f771cdc4dd863821bb89325df3 /gcc/cp/error.c | |
parent | 15f82d80cfbf834365f5819d75aaa9eeb9321224 (diff) | |
download | gcc-ca23341b28cd3af7985b83a6479107d9ea145a90.zip gcc-ca23341b28cd3af7985b83a6479107d9ea145a90.tar.gz gcc-ca23341b28cd3af7985b83a6479107d9ea145a90.tar.bz2 |
Clean up -Wformat-diag warnings (PR bootstrap/97622, PR bootstrap/94982)
gcc/c-family/ChangeLog:
PR bootstrap/94982
* c-attribs.c (handle_patchable_function_entry_attribute): Avoid
-Wformat-diag.
gcc/cp/ChangeLog:
PR bootstrap/94982
* constraint.cc (debug_argument_list): Avoid -Wformat-diag.
* error.c (function_category): Same.
(print_template_differences): Same.
* logic.cc (debug): Same.
* name-lookup.c (lookup_using_decl): Same.
* parser.c (maybe_add_cast_fixit): Same.
(cp_parser_template_introduction): Same.
* typeck.c (access_failure_info::add_fixit_hint): Same.
gcc/ChangeLog:
PR bootstrap/97622
PR bootstrap/94982
* config/i386/i386-options.c (ix86_valid_target_attribute_inner_p):
Avoid -Wformat-diag.
* digraph.cc (struct test_edge): Same.
* dumpfile.c (dump_loc): Same.
(dump_context::begin_scope): Same.
* edit-context.c (edited_file::print_diff): Same.
(edited_file::print_diff_hunk): Same.
* json.cc (object::print): Same.
* lto-wrapper.c (merge_and_complain): Same.
* reload.c (find_reloads): Same.
* tree-diagnostic-path.cc (print_path_summary_as_text): Same.
* ubsan.c (ubsan_type_descriptor): Same.
gcc/jit/ChangeLog:
PR bootstrap/94982
* jit-recording.c (recording::function::dump_to_dot): Avoid
-Wformat-diag.
(recording::block::dump_to_dot): Same.
gcc/testsuite/ChangeLog:
PR bootstrap/94982
* c-c++-common/patchable_function_entry-error-3.c: Adjust text
of expected warning.
Diffstat (limited to 'gcc/cp/error.c')
-rw-r--r-- | gcc/cp/error.c | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/gcc/cp/error.c b/gcc/cp/error.c index d27545d..ff701fc 100644 --- a/gcc/cp/error.c +++ b/gcc/cp/error.c @@ -3553,6 +3553,14 @@ function_category (tree fn) return _("In function %qs"); } +/* Disable warnings about missing quoting in GCC diagnostics for + the pp_verbatim calls. Their format strings deliberately don't + follow GCC diagnostic conventions. */ +#if __GNUC__ >= 10 +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wformat-diag" +#endif + /* Report the full context of a current template instantiation, onto BUFFER. */ static void @@ -4053,6 +4061,10 @@ print_template_differences (pretty_printer *pp, tree type_a, tree type_b, pp_printf (pp, ">"); } +#if __GNUC__ >= 10 +# pragma GCC diagnostic pop +#endif + /* As type_to_string, but for a template, potentially colorizing/eliding in comparison with PEER. For example, if TYPE is map<int,double> and PEER is map<int,int>, @@ -4152,9 +4164,12 @@ add_quotes (const char *content, bool show_color) pretty_printer tmp_pp; pp_show_color (&tmp_pp) = show_color; - /* We have to use "%<%s%>" rather than "%qs" here in order to avoid - quoting colorization bytes within the results. */ - pp_printf (&tmp_pp, "%<%s%>", content); + /* We use pp_quote & pp_string rather than pp_printf with "%<%s%>" + or "%qs" here in order to avoid quoting colorization bytes within + the results, and to avoid -Wformat-diag. */ + pp_quote (&tmp_pp); + pp_string (&tmp_pp, content); + pp_quote (&tmp_pp); return pp_ggc_formatted_text (&tmp_pp); } |