From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 622983858025; Thu, 5 May 2022 02:50:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 622983858025 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: Thu, 05 May 2022 02:50:26 +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: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned 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: Thu, 05 May 2022 02:50:26 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D105473 --- Comment #3 from harper at msor dot vuw.ac.nz --- Thank you. Of course the program did not compile with -std=3Df95 because=20 there was no decimal=3D'point' option then. But with -std=3Df2003 or f2008 = or=20 f2018, and with or without n =3D 999 before the read statement, ios was=20 always 0 after it. I had thought that extensions to the relevant standard=20 were supposed to be disallowed when one compiled with a std=3D version.=20 Ifort gave a positive value of ios, which the f2003, f2008 and f2018=20 standards all require for that program. On Thu, 5 May 2022, jvdelisle2 at gmail dot com wrote: > Date: Thu, 5 May 2022 02:14:42 +0000 > From: jvdelisle2 at gmail dot com > To: John Harper > Subject: [Bug fortran/105473] semicolon allowed when list-directed read > integer with decimal=3D'point' > Resent-Date: Thu, 5 May 2022 14:14:52 +1200 (NZST) > Resent-From: >=20 > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D105473 > > Jerry DeLisle changed: > > What |Removed |Added > -------------------------------------------------------------------------= --- > CC| |jvdelisle2 at gmail dot c= om > > --- Comment #1 from Jerry DeLisle --- > Well, looks like we are allowing as an extension. > > $ gfortran -std=3Df95 pr105473.f90 > pr105473.f90:6:27: > > 6 | read(testinput,*,decimal=3D'point',iostat=3Dios) n > | 1 > Error: Fortran 2003: DECIMAL=3D at (1) not allowed in Fortran 95 > > If you set n to some value so that it is 'defined' per the standards like= this: > > ! Does list-directed reading an integer allow some non-integer input? > implicit none > integer n,ios > character(1):: testinput =3D ';' > n =3D 999 > print *,'testinput =3D "',testinput,'"' > read(testinput,*,decimal=3D'point',iostat=3Dios) n > print *,'n=3D',n,' ios=3D',ios > if(ios>0) print *,'testinput was not an integer' > end program > > $ gfortran pr105473.f90 > [jerry@amdr pr105473]$ ./a.out > testinput =3D ";" > n=3D 999 ios=3D 0 > > You will see that nothing is read into n at all. The list read is just e= nded. > > --=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=