public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Mark Eggleston <mark.eggleston@codethink.co.uk>
To: Janne Blomqvist <blomqvist.janne@gmail.com>
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: Fri, 13 Sep 2019 07:34:00 -0000	[thread overview]
Message-ID: <7ce8d898-a4ba-34dd-1f0f-053b8edb4449@codethink.co.uk> (raw)
In-Reply-To: <CAO9iq9G98ojBU7JK2j-sCemODiTJDVZw7O6bJYDKkF93q-_sEQ@mail.gmail.com>


On 13/09/2019 07:54, Janne Blomqvist wrote:
> On Mon, Sep 9, 2019 at 4:52 PM Mark Eggleston
> <mark.eggleston@codethink.co.uk> wrote:
>> To work around these problems I added a new length field to gfc_typespec
>> to used to produce the name of a character type if the character length
>> structure is not present.
>> The addition of the length field is a bit of kludge any pointers
>> regarding a better solution will be appreciated.
> Thanks for the patch, I agree that we should print character type
> names better. However, I'm not really happy with this approach.
> Requiring us to keep track of the character length in two places
> sounds like a recipe for confusing bugs. I don't really have a good
> solution thought out for this, but I think this should be solved
> somehow before committing the patch.
I agree, it was an east fix to get it to work.  The issues with existing 
location for character length should investigated further and a better 
solution found.
>
> Secondly, character lengths can be longer than what fits into int. In
> gfortran.h you'll find
>
> typedef HOST_WIDE_INT gfc_charlen_t;
>
> and then you should use gfc_mpz_get_hwi() instead of mpz_get_si(). And
> for the *printf() format string you should use
> HOST_WIDE_INT_PRINT_DEC.
Acknowledged.
>
> Thanks,

Will submit an updated patch when fixed.

regards,

Mark

-- 
https://www.codethink.co.uk/privacy.html

      reply	other threads:[~2019-09-13  7:34 UTC|newest]

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

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=7ce8d898-a4ba-34dd-1f0f-053b8edb4449@codethink.co.uk \
    --to=mark.eggleston@codethink.co.uk \
    --cc=blomqvist.janne@gmail.com \
    --cc=fortran@gcc.gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    /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).