From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 2848B3858C2C; Mon, 16 May 2022 00:10:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2848B3858C2C From: "harper at msor dot vuw.ac.nz" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/105473] semicolon allowed when list-directed read integer with decimal='point' Date: Mon, 16 May 2022 00:10:09 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Version: 9.4.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: harper at msor dot vuw.ac.nz X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: jvdelisle at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2022 00:10:10 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D105473 --- Comment #11 from harper at msor dot vuw.ac.nz --- Thank you Jerry. Commas as separators with DECIMAL =3D 'comma' may be=20 trickier because commas then do the job that decimal points normally do, and they cannot act as separators. Here is a little test program that reads from all 16 of "2p5q" where p and q are comma,semicolon,blank, or point, using both 'comma' and=20 'point'. It gave me the same 60 lines of output with -std=3Df2003 or=20 -std=3Df2018 ! Does list-directed reading work properly with decimal=3D'comma' ? implicit none real x(2) character(*),parameter:: punc =3D ",; ." integer,parameter:: lpunc =3Dlen(punc) integer ios,i,j character:: msg*80, input(lpunc**2)*4 =3D & [(("2"//punc(i:i)//"5"//punc(j:j),i=3D1,lpunc),j=3D1,lpunc)] do i =3D 1,size(input) print *,'i=3D',i,'input(i) =3D "',input(i),'"' read(input(i),*,decimal=3D'point',iostat=3Dios,iomsg=3Dmsg) x print *,'with decimal=3Dpoint x(:) =3D',x,' ios=3D',ios if(ios/=3D0) print *,trim(msg) x(2) =3D 666 read(input(i),*,decimal=3D'comma',iostat=3Dios,iomsg=3Dmsg) x print *,'with decimal=3Dcomma x(:) =3D',x,' ios=3D',ios if(ios/=3D0) print *,trim(msg) end do end program On Sun, 15 May 2022, jvdelisle at gcc dot gnu.org wrote: > Date: Sun, 15 May 2022 15:56:00 +0000 > From: jvdelisle at gcc dot gnu.org > To: John Harper > Subject: [Bug fortran/105473] semicolon allowed when list-directed read > integer with decimal=3D'point' > Resent-Date: Mon, 16 May 2022 03:56:12 +1200 (NZST) > Resent-From: >=20 > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D105473 > > --- Comment #10 from Jerry DeLisle --- > Just completed good regression testing and have this: > > testinput =3D "1;17;3.14159 " > At line 8 of file pr105473.f90 > Fortran runtime error: Semicolon not allowed as separator with DECIMAL=3D= 'point' > > Now I wonder if I should likewise do the same for the other case with > DECIMAL=3D'comma' and we find a 'comma' separator. > > --=20 > 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.harper@vuw.ac.nz phone +64(0) 4 463 5276=