public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Janne Blomqvist <blomqvist.janne@gmail.com>
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: Fri, 13 Sep 2019 06:54:00 -0000	[thread overview]
Message-ID: <CAO9iq9G98ojBU7JK2j-sCemODiTJDVZw7O6bJYDKkF93q-_sEQ@mail.gmail.com> (raw)
In-Reply-To: <ffb60571-24de-5270-1b35-91dad0e4429e@codethink.co.uk>

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.

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.

Thanks,
-- 
Janne Blomqvist

  parent reply	other threads:[~2019-09-13  6:54 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 ` Janne Blomqvist [this message]
2019-09-13  7:34   ` [PATCH] Fortran - character type names in errors and warning - for review 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=CAO9iq9G98ojBU7JK2j-sCemODiTJDVZw7O6bJYDKkF93q-_sEQ@mail.gmail.com \
    --to=blomqvist.janne@gmail.com \
    --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).