From: Janus Weil <janus@gcc.gnu.org>
To: Steve Kargl <sgk@troutmask.apl.washington.edu>
Cc: gfortran <fortran@gcc.gnu.org>, gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: [Patch, Fortran, F03] PR 84409: check DTIO arguments for character len
Date: Thu, 15 Feb 2018 20:56:00 -0000 [thread overview]
Message-ID: <CAKwh3qhn-FHsPmMsLMJ9upg++s2KRJO=8roJp5J=CieWYRRxGg@mail.gmail.com> (raw)
In-Reply-To: <20180215201611.GA81448@troutmask.apl.washington.edu>
2018-02-15 21:16 GMT+01:00 Steve Kargl <sgk@troutmask.apl.washington.edu>:
> On Thu, Feb 15, 2018 at 09:03:55PM +0100, Janus Weil wrote:
>>
>> Regtests cleanly on x86_64-linux-gnu. Ok for trunk?
>>
>
> Looks good to me with a question below.
Thanks for the feedback, Steve.
>> Index: gcc/fortran/interface.c
>> ===================================================================
>> --- gcc/fortran/interface.c (revision 257672)
>> +++ gcc/fortran/interface.c (working copy)
>> @@ -4702,6 +4702,10 @@ check_dtio_arg_TKR_intent (gfc_symbol *fsym, bool
>> gfc_error ("DTIO dummy argument at %L must be an "
>> "ASSUMED SHAPE ARRAY", &fsym->declared_at);
>>
>> + if (type == BT_CHARACTER && fsym->ts.u.cl->length != NULL)
>> + gfc_error ("DTIO character argument at %L must have assumed length",
>> + &fsym->declared_at);
>> +
>
> If the above is a numbered constraint in the Standard,
> can you add a comment of the form /* F03:C1111. */
> above the if-statement.
Well, the if statement that I'm adding is not covered by a single
clause in the standard. Instead the DTIO interfaces are described as a
whole in a chapter, whose number I'm now adding in the comment above
the function:
Index: gcc/fortran/interface.c
===================================================================
--- gcc/fortran/interface.c (revision 257672)
+++ gcc/fortran/interface.c (working copy)
@@ -4673,7 +4673,7 @@ gfc_check_typebound_override (gfc_symtree* proc, g
/* The following three functions check that the formal arguments
of user defined derived type IO procedures are compliant with
- the requirements of the standard. */
+ the requirements of the standard, see F03:9.5.3.7.2 (F08:9.6.4.8.3). */
static void
check_dtio_arg_TKR_intent (gfc_symbol *fsym, bool typebound, bt type,
@@ -4702,6 +4702,10 @@ check_dtio_arg_TKR_intent (gfc_symbol *fsym, bool
gfc_error ("DTIO dummy argument at %L must be an "
"ASSUMED SHAPE ARRAY", &fsym->declared_at);
+ if (type == BT_CHARACTER && fsym->ts.u.cl->length != NULL)
+ gfc_error ("DTIO character argument at %L must have assumed length",
+ &fsym->declared_at);
+
if (fsym->attr.intent != intent)
gfc_error ("DTIO dummy argument at %L must have INTENT %s",
&fsym->declared_at, gfc_code2string (intents, (int)intent));
Will commit this shortly.
Cheers,
Janus
2018-02-15 21:16 GMT+01:00 Steve Kargl <sgk@troutmask.apl.washington.edu>:
> On Thu, Feb 15, 2018 at 09:03:55PM +0100, Janus Weil wrote:
>>
>> Regtests cleanly on x86_64-linux-gnu. Ok for trunk?
>>
>
> Looks good to me with a question below.
>
>> Index: gcc/fortran/interface.c
>> ===================================================================
>> --- gcc/fortran/interface.c (revision 257672)
>> +++ gcc/fortran/interface.c (working copy)
>> @@ -4702,6 +4702,10 @@ check_dtio_arg_TKR_intent (gfc_symbol *fsym, bool
>> gfc_error ("DTIO dummy argument at %L must be an "
>> "ASSUMED SHAPE ARRAY", &fsym->declared_at);
>>
>> + if (type == BT_CHARACTER && fsym->ts.u.cl->length != NULL)
>> + gfc_error ("DTIO character argument at %L must have assumed length",
>> + &fsym->declared_at);
>> +
>
> If the above is a numbered constraint in the Standard,
> can you add a comment of the form /* F03:C1111. */
> above the if-statement.
>
> --
> Steve
next prev parent reply other threads:[~2018-02-15 20:56 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-15 20:04 Janus Weil
2018-02-15 20:16 ` Steve Kargl
2018-02-15 20:56 ` Janus Weil [this message]
2018-02-15 21:03 ` Steve Kargl
2018-02-15 21:17 ` Janus Weil
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='CAKwh3qhn-FHsPmMsLMJ9upg++s2KRJO=8roJp5J=CieWYRRxGg@mail.gmail.com' \
--to=janus@gcc.gnu.org \
--cc=fortran@gcc.gnu.org \
--cc=gcc-patches@gcc.gnu.org \
--cc=sgk@troutmask.apl.washington.edu \
/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).