public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Steve Kargl <sgk@troutmask.apl.washington.edu>
To: Mark Eggleston <mark.eggleston@codethink.co.uk>
Cc: gcc-patches <gcc-patches@gcc.gnu.org>, fortran <fortran@gcc.gnu.org>
Subject: Re: [PATCH] Fortran - character type names in errors and warning - for review'
Date: Thu, 12 Sep 2019 21:00:00 -0000	[thread overview]
Message-ID: <20190912210029.GA38850@troutmask.apl.washington.edu> (raw)
In-Reply-To: <ffb60571-24de-5270-1b35-91dad0e4429e@codethink.co.uk>

On Mon, Sep 09, 2019 at 02:52:20PM +0100, Mark Eggleston wrote:
> gcc/fortran
> 
>      Mark Eggleston <mark.eggleston@codethink.com>
> 
>      * arith.c (gfc_arith_concat): Set length field in typespec.
>      * expr.c (gfc_get_character_expr): Set length field in typespec.
>      * gfortran.h: Add length field to gfc_typespec for use to allow the
>      length to available for character literals.
>      * interface.c (gfc_check_dummy_characteristics): Use gfc_dummy_typename
>      instead of gfc_typename when constructing error message to allow for
>      CHARACTER(*) and CHARACTER(*,4).
>      (compare_parameter): Use gfc_dummy_typename for formal argument when
>      constructing error message to allow for CHARACTER(*) and
>      CHARACTER(*,4).
>      * intrinsic.c (gfc_actual_arglist): Reword error message so that
>      CHARACTER(*) or CHARACTER(*,4) can be reported as the target type.  Use
>      gfc_dummy_typename for the formal argument.
>      * misc.c (gfc_typename): Add new local variable length and initialise
>      with the value from the length field in typespec passed in.  If there
>      is a character structure use the value from there for length.  If the
>      kind is the default character kind construct the type name using length
>      otherwise use the length followed by kind separated by a comma.
>      (gfc_dummy_typename): New routine for use with formal arguments, if the
>      typespec does not have a character length structure then the length is
>      assumed and * is used for the length, if kind is not the default
>      character kind follow * with a comma and then the kind.
> 
> gcc/testsuite
> 
>      Mark Eggleston <mark.eggleston@codethink.com>
> 
>      * gfortran.dg/bad_operands.f90: New test.
>      * gfortran.dg/character mismatch.f90: New test.
>      * gfortran.dg/compare_interfaces.f90: New test.
>      * gfortran.dg/widechar_intrinsics_1.f90: Checked for specific character
>      type names instead of "Type of argument".
>      * gfortran.dg/widechar_intrinsics_2.f90: Checked for specific character
>      type names instead of "Type of argument".
>      * gfortran.dg/widechar_intrinsics_3.f90: Checked for specific character
>      type names instead of "Type of argument".
> 

This looks OK to me.  I don't know if anyone else will
glance at the patch.  You said that the patch has the
feeling of a kludge.  This is probably a by-product of
bolting kind=4 support onto what gfortran inherited long
ago.

-- 
steve

  reply	other threads:[~2019-09-12 21:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-09 13:52 [PATCH] Fortran - character type names in errors and warning - for review Mark Eggleston
2019-09-12 21:00 ` Steve Kargl [this message]
2019-09-13  6:54 ` Janne Blomqvist
2019-09-13  7:34   ` Mark Eggleston

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190912210029.GA38850@troutmask.apl.washington.edu \
    --to=sgk@troutmask.apl.washington.edu \
    --cc=fortran@gcc.gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=mark.eggleston@codethink.co.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).