aboutsummaryrefslogtreecommitdiff
path: root/gcc/edit-context.c
diff options
context:
space:
mode:
authorThomas Koenig <tkoenig@gcc.gnu.org>2021-01-03 21:40:04 +0100
committerThomas Koenig <tkoenig@gcc.gnu.org>2021-01-03 21:40:04 +0100
commitafae4a55ccaa0de95ea11e5f634084db6ab2f444 (patch)
treed632cc867d10410ba9fb750523be790b86846ac4 /gcc/edit-context.c
parent9d9a82ec8478ff52c7a9d61f58cd2a7b6295b5f9 (diff)
parentd2eb616a0f7bea78164912aa438c29fe1ef5774a (diff)
downloadgcc-afae4a55ccaa0de95ea11e5f634084db6ab2f444.zip
gcc-afae4a55ccaa0de95ea11e5f634084db6ab2f444.tar.gz
gcc-afae4a55ccaa0de95ea11e5f634084db6ab2f444.tar.bz2
Merge branch 'master' into devel/coarray_native
Diffstat (limited to 'gcc/edit-context.c')
-rw-r--r--gcc/edit-context.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/gcc/edit-context.c b/gcc/edit-context.c
index 97897d6..80641c2 100644
--- a/gcc/edit-context.c
+++ b/gcc/edit-context.c
@@ -447,8 +447,13 @@ edited_file::print_diff (pretty_printer *pp, bool show_filenames)
if (show_filenames)
{
pp_string (pp, colorize_start (pp_show_color (pp), "diff-filename"));
- pp_printf (pp, "--- %s\n", m_filename);
- pp_printf (pp, "+++ %s\n", m_filename);
+ /* Avoid -Wformat-diag in non-diagnostic output. */
+ pp_string (pp, "--- ");
+ pp_string (pp, m_filename);
+ pp_newline (pp);
+ pp_string (pp, "+++ ");
+ pp_string (pp, m_filename);
+ pp_newline (pp);
pp_string (pp, colorize_stop (pp_show_color (pp)));
}
@@ -519,8 +524,9 @@ edited_file::print_diff_hunk (pretty_printer *pp, int old_start_of_hunk,
= get_effective_line_count (old_start_of_hunk, old_end_of_hunk);
pp_string (pp, colorize_start (pp_show_color (pp), "diff-hunk"));
- pp_printf (pp, "@@ -%i,%i +%i,%i @@\n", old_start_of_hunk, old_num_lines,
- new_start_of_hunk, new_num_lines);
+ pp_printf (pp, "%s -%i,%i +%i,%i %s",
+ "@@", old_start_of_hunk, old_num_lines,
+ new_start_of_hunk, new_num_lines, "@@\n");
pp_string (pp, colorize_stop (pp_show_color (pp)));
int line_num = old_start_of_hunk;