public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jerry D <jvdelisle2@gmail.com>
To: Harald Anlauf <anlauf@gmx.de>,
	sgk@troutmask.apl.washington.edu, gfortran <fortran@gcc.gnu.org>
Cc: gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: [patch, fortran] PR109662 Namelist input with comma after name accepted
Date: Sun, 7 May 2023 10:33:40 -0700	[thread overview]
Message-ID: <a7b86024-df64-64e8-40bc-4019ec80b7df@gmail.com> (raw)
In-Reply-To: <508ee742-97fa-9f61-ab65-98d3fa8e7dca@gmx.de>

On 5/6/23 11:15 AM, Harald Anlauf via Fortran wrote:
> Hi Jerry, Steve,
> 
> I think I have to pour a little water into the wine.
> 
> The patch fixes the reported issue only for a comma after
> the namelist name, but we still accept a few other illegal
> characters, e.g. ';', because:
> 
> #define is_separator(c) (c == '/' ||  c == ',' || c == '\n' || c == ' ' \
>                           || c == '\t' || c == '\r' || c == ';' || \
>               (dtp->u.p.namelist_mode && c == '!'))
> 
> We don't want that in standard conformance mode, or do we?
> 
> Cheers,
> Harald
> 
> On 5/6/23 06:02, Steve Kargl via Gcc-patches wrote:
>> On Fri, May 05, 2023 at 08:41:48PM -0700, Jerry D via Fortran wrote:
>>> The attached patch adds a check for the invalid comma and emits a 
>>> runtime
>>> error if -std=f95,f2003,f2018 are specified at compile time.
>>>
>>> Attached patch includes a new test case.
>>>
>>> Regression tested on x86_64-linux-gnu.
>>>
>>> OK for mainline?
>>>
>>
>> Yes.  Thanks for the fix.  It's been a long time since
>> I looked at libgfortran code and couldn't quite determine
>> where to start to fix this.
>>
> 

As I think back, I don't recall ever seeing a semi-colon used after a 
NAMELIST name, so I think we should reject it always.  The other "soft" 
blanks we should allow.

I will make a another patch on trunk to reject the semi-colon and if no 
one objects here I will test and push it.

Regards,

Jerry


  parent reply	other threads:[~2023-05-07 17:33 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-06  3:41 Jerry D
2023-05-06  4:02 ` Steve Kargl
2023-05-06 18:15   ` Harald Anlauf
2023-05-06 18:15     ` Harald Anlauf
2023-05-07 17:33     ` Jerry D [this message]
2023-05-07 18:33       ` Harald Anlauf
2023-05-07 18:33         ` Harald Anlauf
2023-05-08  0:13         ` Steve Kargl
2023-05-08 19:03           ` Harald Anlauf
2023-05-08 19:03             ` Harald Anlauf
2023-05-12 20:36             ` Jerry D

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=a7b86024-df64-64e8-40bc-4019ec80b7df@gmail.com \
    --to=jvdelisle2@gmail.com \
    --cc=anlauf@gmx.de \
    --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).