https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109662

--- Comment #15 from john.harper at vuw dot ac.nz ---
Sorry: what I should have said was that

If and only if a comma after a namelist name was a pre-2003 possibility 
for gfortran then it makes sense to reject a semicolon there when the 
decimal edit mode is COMMA, which first got into the standard with f2003.

John H

On Sun, 7 May 2023, john.harper at vuw dot ac.nz wrote:

> Date: Sun, 7 May 2023 21:46:33 +0000
> From: john.harper at vuw dot ac.nz <gcc-bugzi...@gcc.gnu.org>
> To: John Harper <john.har...@vuw.ac.nz>
> Subject: [Bug libfortran/109662] bad namelist input but gfortran accepted it
> Resent-Date: Mon, 8 May 2023 09:46:44 +1200 (NZST)
> Resent-From: <john.har...@vuw.ac.nz>
> 
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109662
>
> --- Comment #14 from john.harper at vuw dot ac.nz ---
> Rejecting a semicolon after the namelist name even if the decimal edit
> mode is COMMA makes sense because COMMA was first allowed in f2003,
> provided that semicolons in namelist were a pre-f2003 legacy possibility.
>
> John H
>
> On Sun, 7 May 2023, jvdelisle at gcc dot gnu.org wrote:
>
>> Date: Sun, 7 May 2023 18:14:23 +0000
>> From: jvdelisle at gcc dot gnu.org <gcc-bugzi...@gcc.gnu.org>
>> To: John Harper <john.har...@vuw.ac.nz>
>> Subject: [Bug libfortran/109662] bad namelist input but gfortran accepted it
>> Resent-Date: Mon, 8 May 2023 06:14:37 +1200 (NZST)
>> Resent-From: <john.har...@vuw.ac.nz>
>>
>> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109662
>>
>> --- Comment #12 from Jerry DeLisle <jvdelisle at gcc dot gnu.org> ---
>> A additional adjustment to reject the semi-colon always.
>>
>> diff --git a/libgfortran/io/list_read.c b/libgfortran/io/list_read.c
>> index 78bfd9e8787..db3330060ce 100644
>> --- a/libgfortran/io/list_read.c
>> +++ b/libgfortran/io/list_read.c
>> @@ -3598,9 +3598,9 @@ find_nml_name:
>>
>>   /* A trailing space is required, we allow a comma with std=gnu.  */
>>   c = next_char (dtp);
>> -  if (c == ',' && !(compile_options.allow_std & GFC_STD_GNU))
>> +  if ((c == ',' && !(compile_options.allow_std & GFC_STD_GNU)) || c == ';')
>>     generate_error (&dtp->common, LIBERROR_READ_VALUE,
>> -                   "Comma after namelist name not allowed");
>> +                   "Non blank after namelist name not allowed");
>>
>>   if (!is_separator(c) && c != '!')
>>     {
>>
>> --
>> You are receiving this mail because:
>> You reported the bug.
>>
>
>
> -- John Harper, School of Mathematics and Statistics
> Victoria Univ. of Wellington, PO Box 600, Wellington 6140, New Zealand.
> e-mail john.har...@vuw.ac.nz phone +64(0) 4 463 5276
>
> -- 
> You are receiving this mail because:
> You reported the bug.
>


-- John Harper, School of Mathematics and Statistics
Victoria Univ. of Wellington, PO Box 600, Wellington 6140, New Zealand.
e-mail john.har...@vuw.ac.nz phone +64(0) 4 463 5276

Reply via email to