diff options
author | Manuel López-Ibáñez <manu@gcc.gnu.org> | 2015-05-20 15:58:15 +0000 |
---|---|---|
committer | Manuel López-Ibáñez <manu@gcc.gnu.org> | 2015-05-20 15:58:15 +0000 |
commit | e4129dd0c9ec71767eeae6ddb3f65f697c6d8140 (patch) | |
tree | 0a01c9b29f9f929c3e5b95f242beb9a13d496df4 | |
parent | db7ffcabaf01826192370231d15b64cc15958aeb (diff) | |
download | gcc-e4129dd0c9ec71767eeae6ddb3f65f697c6d8140.zip gcc-e4129dd0c9ec71767eeae6ddb3f65f697c6d8140.tar.gz gcc-e4129dd0c9ec71767eeae6ddb3f65f697c6d8140.tar.bz2 |
diagnostic.c (diagnostic_print_caret_line): Fix off-by-one error when printing the caret character.
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
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/diagnostic.c | 3 |
2 files changed, 7 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ba1186d..fe4dfc4 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -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. diff --git a/gcc/diagnostic.c b/gcc/diagnostic.c index 8f7a9e1..8b70a16 100644 --- a/gcc/diagnostic.c +++ b/gcc/diagnostic.c @@ -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); |