From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.95.76.21]) by sourceware.org (Postfix) with ESMTPS id 05A99384EF61; Mon, 12 Dec 2022 20:07:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 05A99384EF61 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=troutmask.apl.washington.edu Authentication-Results: sourceware.org; spf=none smtp.mailfrom=troutmask.apl.washington.edu Received: from troutmask.apl.washington.edu (localhost [127.0.0.1]) by troutmask.apl.washington.edu (8.16.1/8.16.1) with ESMTPS id 2BCK7DWj061891 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Mon, 12 Dec 2022 12:07:13 -0800 (PST) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.16.1/8.16.1/Submit) id 2BCK7B8u061890; Mon, 12 Dec 2022 12:07:11 -0800 (PST) (envelope-from sgk) Date: Mon, 12 Dec 2022 12:07:06 -0800 From: Steve Kargl To: Harald Anlauf via Fortran Cc: gcc-patches Subject: Re: [PATCH] Fortran: improve checking of assumed size array spec [PR102180] Message-ID: Reply-To: sgk@troutmask.apl.washington.edu References: <16de1714-fb7d-de19-d8ab-0034bf082fd2@gmx.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <16de1714-fb7d-de19-d8ab-0034bf082fd2@gmx.de> X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,KAM_DMARC_STATUS,KAM_LAZY_DOMAIN_SECURITY,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Mon, Dec 12, 2022 at 08:49:50PM +0100, Harald Anlauf via Fortran wrote: > > Committed as r13-4623-gcf5327b89ab610. > To be clear, I have no problems with this commit. But, just a FYI, there is gfc_peek_ascii_char(), which allows you to look at the next character without having to keep track of the locus. > + { > + locus old_loc = gfc_current_locus; > + if (gfc_match_char ('*') == MATCH_YES) gfc_gobble_whitespace (); /* Can't remember if matching up to this eats whitespace. */ if (gfc_peek_ascii_char () == '*') > + { > + /* F2018:R821: "assumed-implied-spec is [ lower-bound : ] *". */ > + gfc_error ("A lower bound must precede colon in " > + "assumed-size array specification at %L", &old_loc); > + return AS_UNKNOWN; > + } > + else > + { gfc_current_locus = old_loc; /* Is this needed? */ > + return AS_DEFERRED; > + } > + } -- Steve