Manuel López-Ibáñez <lopeziba...@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

Reply via email to