diagnostic.c (diagnostic_print_caret_line): Fix off-by-one error when printing the...
authorManuel López-Ibáñez <manu@gcc.gnu.org>
Wed, 20 May 2015 15:58:15 +0000 (15:58 +0000)
committerManuel López-Ibáñez <manu@gcc.gnu.org>
Wed, 20 May 2015 15:58:15 +0000 (15:58 +0000)
gcc/ChangeLog

2015-05-20  Manuel López-Ibáñez  <manu@gcc.gnu.org>

       * diagnostic.c (diagnostic_print_caret_line): Fix off-by-one error
       when printing the caret character.

From-SVN: r223446

gcc/ChangeLog
gcc/diagnostic.c

index ba1186db344e82720ef4bd588c850bcc81b36491..fe4dfc45e5cde67b12e0e8bf9fd43d00f6e3dbdf 100644 (file)
@@ -1,3 +1,8 @@
+2015-05-20  Manuel López-Ibáñez  <manu@gcc.gnu.org>
+
+       * diagnostic.c (diagnostic_print_caret_line): Fix off-by-one error
+       when printing the caret character.
+
 2015-05-20  Marek Polacek  <polacek@redhat.com>
 
        * cfgexpand.c (expand_debug_expr): Use UNARY_CLASS_P.
index 8f7a9e1b478fd0427c5fea088186b6841f912973..8b70a16ad098e5a58705fd8a827ba95283652fb5 100644 (file)
@@ -420,7 +420,8 @@ diagnostic_print_caret_line (diagnostic_context * context,
   int caret_min = cmin == xloc1.column ? caret1 : caret2;
   int caret_max = cmin == xloc1.column ? caret2 : caret1;
 
-  pp_space (context->printer);
+  /* cmin is >= 1, but we indent with an extra space at the start like
+     we did above.  */
   int i;
   for (i = 0; i < cmin; i++)
     pp_space (context->printer);