From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 47721 invoked by alias); 15 Feb 2018 20:56:03 -0000 Mailing-List: contact fortran-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: fortran-owner@gcc.gnu.org Received: (qmail 47697 invoked by uid 89); 15 Feb 2018 20:56:02 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-10.0 required=5.0 tests=AWL,BAYES_00,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,GIT_PATCH_2,GIT_PATCH_3,KAM_ASCII_DIVIDERS,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy= X-Spam-User: qpsmtpd, 2 recipients X-HELO: mail-yw0-f176.google.com Received: from mail-yw0-f176.google.com (HELO mail-yw0-f176.google.com) (209.85.161.176) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 15 Feb 2018 20:56:01 +0000 Received: by mail-yw0-f176.google.com with SMTP id v196so724105ywc.6; Thu, 15 Feb 2018 12:56:00 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=HsTEEeYH3uvc5oVwg61ci60HZPXcyrFDCFRcsIDgKF0=; b=PjAOt4fhYK/TTNdhzEDBVAxUh/RFh7r/EBoLp7sAvfVN4wQyr/g68gkOo6F5gzZ+mT AabzXzywID0sq6KaNvwzUjQuADXkuxCQcTYnrnT48UgI2l/3Nm+JeruL736LXNKukNGr kByV7eHK7BMKKd1JJ5FT5GKC9DEWqLQAhxS4Tk8Fb/nuV0yruLud3bpOgYtQgKBs3ALI pCJu2gblgOVF0MA0lqbfKjxRCqUoEfwXemVOBXcyjfdQYdrJAj5NxREtPOi8fZaCjTnn S8a3Cjqx3Nfh1C0wqaX7mw7CGoPkFfohRy5F7Gh8AceDCCqZVkPCeXksx9j2KUnwKGUU gj5w== X-Gm-Message-State: APf1xPArBt9owSMl/UZsSpY5KgKKcR6Mq/fFkksF4tW1guDMYDVgH6OC s3Qs5BQ+Yl+4szhmMPXhrjJtdWkt0ANqXCrw5C9Mlg== X-Google-Smtp-Source: AH8x2257CWVjZrQP9YGk1LZ3Kxa0rgknGh6yyXeIHyffVzQCjiIwgMuiy9K20XrjPdIloi2XdJF17k0pG6yofhv2T8g= X-Received: by 10.37.147.143 with SMTP id a15mr3177208ybm.221.1518728159136; Thu, 15 Feb 2018 12:55:59 -0800 (PST) MIME-Version: 1.0 Received: by 10.129.146.71 with HTTP; Thu, 15 Feb 2018 12:55:58 -0800 (PST) In-Reply-To: <20180215201611.GA81448@troutmask.apl.washington.edu> References: <20180215201611.GA81448@troutmask.apl.washington.edu> From: Janus Weil Date: Thu, 15 Feb 2018 20:56:00 -0000 Message-ID: Subject: Re: [Patch, Fortran, F03] PR 84409: check DTIO arguments for character len To: Steve Kargl Cc: gfortran , gcc-patches Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2018-02/txt/msg00102.txt.bz2 2018-02-15 21:16 GMT+01:00 Steve Kargl : > 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 : > 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