PING: https://gcc.gnu.org/ml/gcc-patches/2015-05/msg01511.html

This only needs approval from Fortran maintainers.

On 17 May 2015 at 20:22, Manuel López-Ibáñez <lopeziba...@gmail.com> wrote:
> Hi,
>
> This patch finishes the conversion of Fortran diagnostics to use the
> common diagnostics by removing all gfc_error*_1 variants.
>
> I noticed that whether some buffered gfc_error_1() end up printed may
> depend on whether a gfc_error_now is given or not, and not only on
> whether there is any output buffered. Thus, I reintroduced a new
> error_buffer of type gfc_buffer_error.
>
> The rest is mostly mechanic.
>
> I did not make an attempt in this patch to remove all code that has
> become obsolete now:
>
> gfc_get_terminal_width (already implemented in diagnostics.c)
> error_char (already empty, but used by other obsolete functions)
> error_string (obsolete, just use %s)
> error_uinteger (obsolete, just use %lu)
> error_integer (obsolete, just use %ld)
> gfc_widechar_display_length, gfc_wide_display_length,
> print_wide_char_into_buffer, gfc_print_wide_char (I'm not sure how
> this functionality differs from what the common diagnostics already
> do, perhaps some of it should be moved to the common code)
> show_locus (obsolete, except "Included at" handling should be moved to
> the common diagnostics, no testcase is testing this).
> show_loci (obsolete, except "During initialization" handling should be
> moved to the common diagnostics, no testcase is testing this)
> error_print, error_printf (obsolete)
>
> Bootstrapped and regression tested on x86_64-linux-gnu.
>
> OK?
>
> gcc/fortran/ChangeLog:
>
> 2015-05-17  Manuel López-Ibáñez  <m...@gcc.gnu.org>
>
>     PR fortran/44054
>     * gfortran.h (struct gfc_error_buf): Rename as
>     gfc_error_buffer. Move closer to push, pop and free
>     methods. Reimplement using an output_buffer.
>     * error.c (errors, warnings, warning_buffer, cur_error_buffer):
>     Delete everywhere in this file.
>     (error_char): Delete all contents.
>     (gfc_increment_error_count): Delete.
>     (gfc_error_now): Update comment. Set error_buffer.flag.
>     (gfc_warning_check): Do not handle warning_buffer.
>     (gfc_error_1): Delete.
>     (gfc_error_now_1): Delete.
>     (gfc_error_check): Simplify.
>     (gfc_move_error_buffer_from_to): Renamed from
>     gfc_move_output_buffer_from_to.
>     (gfc_push_error): Handle only gfc_error_buffer.
>     (gfc_pop_error): Likewise.
>     (gfc_free_error): Likewise.
>     (gfc_get_errors): Remove warnings and errors.
>     (gfc_diagnostics_init): Use static error_buffer.
>     (gfc_error_1,gfc_error_now_1): Delete declarations.
>     * symbol.c, decl.c, trans-common.c, data.c, expr.c, expr.c,
>     frontend-passes.c, resolve.c, match.c, parse.c: Replace
>     gfc_error_1 with gfc_error and gfc_error_now_1 with gfc_error_1
>     everywhere.
>     * f95-lang.c (gfc_be_parse_file): Do not update errorcount and
>     warningcount here.
>     * primary.c (match_complex_constant): Replace gfc_error_buf and
>     output_buffer with gfc_error_buffer.

Reply via email to