Hi all,

the attached patch is a follow-up to my recent patch for PR57217. It
splits up the function 'compare_type_rank' into two separate ones
('compare_type' and 'compare_rank'), in order to generate more precise
error messages. In particular it now prints the values of the
differing types or ranks. The old function 'compare_type_rank' is
kept, since it is still needed in some places, but calls the two new
functions now.

In addition to this, the patch contains a part which concerns the
function 'gfc_terminal_width': Currently this returns a fixed value of
80, which means that all source lines are trimmed to 80 characters in
the error messages. I increased this default value to 132 (in order to
accommodate standard free-format lines), and added a part which tries
to determine the terminal width from the environment variable $COLUMNS
(the corresponding code was borrowed from gcc/opts.c). Further, I
moved the function to error.c (which is the only place where it is
used), made it static and renamed it.

The patch was regtested on x86_64-unknown-linux-gnu. Ok for trunk?

Cheers,
Janus


2013-05-30  Janus Weil  <ja...@gcc.gnu.org>

    PR fortran/57217
    * gfortran. h (gfc_terminal_width): Remove prototype.
    * error.c (get_terminal_width): Moved here from misc.c. Renamed.
    Try to determine terminal width from environment variable. Increase
    default value to 132.
    * interface.c (compare_type, compare_rank): New functions.
    (compare_type_rank, check_dummy_characteristics,
    check_result_characteristics, gfc_compare_interfaces): Use them.
    (symbol_rank): Slightly modified and moved.
    * misc.c (gfc_terminal_width): Moved to error.c.


2013-05-30  Janus Weil  <ja...@gcc.gnu.org>

    PR fortran/57217
    * gfortran.dg/dummy_procedure_5.f90: Modified error message.
    * gfortran.dg/interface_26.f90: Ditto.
    * gfortran.dg/proc_ptr_11.f90: Ditto.
    * gfortran.dg/proc_ptr_15.f90: Ditto.
    * gfortran.dg/proc_ptr_comp_20.f90: Ditto.
    * gfortran.dg/proc_ptr_comp_33.f90: Ditto.
    * gfortran.dg/proc_ptr_result_5.f90: Ditto.
    * gfortran.dg/typebound_override_1.f90: Ditto.
    * gfortran.dg/typebound_override_4.f90: Ditto.
    * gfortran.dg/typebound_proc_6.f03: Ditto.

Attachment: compare_type_rank.diff
Description: Binary data

Reply via email to