This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Move caret printing to diagnostics_finalizer
- From: Dodji Seketeli <dodji at redhat dot com>
- To: Manuel LÃpez-IbÃÃez <lopezibanez at gmail dot com>
- Cc: Gcc Patch List <gcc-patches at gcc dot gnu dot org>, Jason Merrill <jason at redhat dot com>, "Joseph S. Myers" <joseph at codesourcery dot com>
- Date: Tue, 19 Aug 2014 17:06:17 +0200
- Subject: Re: [PATCH] Move caret printing to diagnostics_finalizer
- Authentication-results: sourceware.org; auth=none
- References: <CAESRpQBXF5g--1YOXWczEy=h4nUxuFW0qD2h8pESqTJAGUTszA at mail dot gmail dot com>
Manuel LÃpez-IbÃÃez <lopezibanez@gmail.com> writes:
> This patch is in preparation for further patches moving the Fortran FE
> to use the common diagnostics machinery.
>
> Fortran has its own way of printing the caret information, so we need
> a way to override the default in the diagnostics machinery. A simple
> way is to move the printing of the caret (plus the destruction of the
> prefix and printing a newline at the end) to the
> diagnostic_finalizer, so Fortran can override the whole thing with its
> own finalizer.
>
> This means that the c-family finalizer needs to invoke the caret
> explicitly. The C++ finalizer was destroying the prefix even thought
> this was done by the common code anyway. Thus now there is only one
> finalizer for both C and C++.
>
>
> gcc/ChangeLog:
>
> 2014-08-16 Manuel LÃpez-IbÃÃez <manu.gnu.org>
>
> * diagnostic.c (default_diagnostic_finalizer): Move caret printing
> to here ...
> (diagnostic_report_diagnostic): ... from here.
> * toplev.c (general_init): Move code to c-family.
>
> gcc/cp/ChangeLog:
>
> 2014-08-16 Manuel LÃpez-IbÃÃez <manu.gnu.org>
>
> * error.c (cp_diagnostic_finalizer): Delete.
> (init_error): Do not set diagnostic_finalizer here.
>
> gcc/c-family/ChangeLog:
>
> 2014-08-16 Manuel LÃpez-IbÃÃez <manu.gnu.org>
>
> * c-opts.c: Include tree-diagnostics.h.
> (c_diagnostic_finalizer): New.
> (c_common_initialize_diagnostics): Use it.
> Bootstrapped and regression tested on x86-64-linux.
>
> OK?
This is OK for me.
Please commit it if nobody objects in the next 48 hours.
Thank you :-)
Cheers.
--
Dodji