aboutsummaryrefslogtreecommitdiff
path: root/gcc/diagnostic.c
diff options
context:
space:
mode:
authormanu <manu@138bc75d-0d04-0410-961f-82ee72b054a4>2014-08-21 00:27:25 +0000
committermanu <manu@138bc75d-0d04-0410-961f-82ee72b054a4>2014-08-21 00:27:25 +0000
commitd19fa5627239c551ca72e23824d747c81be27589 (patch)
tree8e4a6ff9aef324beb077e82626a2a4e8f6c910e9 /gcc/diagnostic.c
parente43ee83e92cdd47e03982cdf0056b184de35b366 (diff)
gcc/ChangeLog:
2014-08-21 Manuel López-Ibáñez <manu@gcc.gnu.org> PR fortran/44054 * diagnostic.c: Set default caret. (diagnostic_show_locus): Use it. Tell pretty-printer that a new line is needed. * diagnostic.h (struct diagnostic_context): gcc/fortran/ChangeLog: 2014-08-21 Manuel López-Ibáñez <manu@gcc.gnu.org> PR fortran/44054 * error.c (gfc_diagnostic_build_locus_prefix): New function. (gfc_diagnostic_starter): Follow Fortran FE diagnostics. (gfc_diagnostic_finalizer): Do not call default finalizer. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@214251 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/diagnostic.c')
-rw-r--r--gcc/diagnostic.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/diagnostic.c b/gcc/diagnostic.c
index 9e6bfe52bff..73666d62fc7 100644
--- a/gcc/diagnostic.c
+++ b/gcc/diagnostic.c
@@ -131,6 +131,7 @@ diagnostic_initialize (diagnostic_context *context, int n_opts)
context->classify_diagnostic[i] = DK_UNSPECIFIED;
context->show_caret = false;
diagnostic_set_caret_max_width (context, pp_line_cutoff (context->printer));
+ context->caret_char = '^';
context->show_option_requested = false;
context->abort_on_error = false;
context->show_column = false;
@@ -280,7 +281,7 @@ adjust_line (const char *line, int line_width,
}
/* Print the physical source line corresponding to the location of
- this diagnostics, and a caret indicating the precise column. */
+ this diagnostic, and a caret indicating the precise column. */
void
diagnostic_show_locus (diagnostic_context * context,
const diagnostic_info *diagnostic)
@@ -328,9 +329,11 @@ diagnostic_show_locus (diagnostic_context * context,
/* pp_printf does not implement %*c. */
size_t len = s.column + 3 + strlen (caret_cs) + strlen (caret_ce);
buffer = XALLOCAVEC (char, len);
- snprintf (buffer, len, "%s %*c%s", caret_cs, s.column, '^', caret_ce);
+ snprintf (buffer, len, "%s %*c%s", caret_cs, s.column, context->caret_char,
+ caret_ce);
pp_string (context->printer, buffer);
pp_set_prefix (context->printer, saved_prefix);
+ pp_needs_newline (context->printer) = true;
}
/* Functions at which to stop the backtrace print. It's not