From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A430D394742C; Tue, 29 Jun 2021 11:09:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A430D394742C From: "burnus at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/101255] New: FLUSH statement - error should be negative Date: Tue, 29 Jun 2021 11:09:19 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: burnus at gcc dot gnu.org 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: bug_id short_desc product version bug_status keywords bug_severity priority component assigned_to reporter target_milestone Message-ID: 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: Tue, 29 Jun 2021 11:09:19 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D101255 Bug ID: 101255 Summary: FLUSH statement - error should be negative Product: gcc Version: 12.0 Status: UNCONFIRMED Keywords: wrong-code Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: burnus at gcc dot gnu.org Target Milestone: --- F2018 states: "Fortran 2008 specifies that the IOSTAT=3D variable shall be set to a processor-dependent negative value if the flush operation is not supported = for the unit specified. This document specifies that the processor-dependent negative27integer value shall be different from the named constants IOSTAT_= EOR or IOSTAT_END from the intrinsic28module ISO_FORTRAN_ENV." However, the following program prints: 5002 Specified UNIT in FLUSH is not connected=20=20=20=20=20=20=20= =20=20=20 -2 -1 shouldn't the 5002 be a negative number (such as -5002)? use iso_fortran_env implicit none character(len=3D50) :: err integer :: i !open(99) !close(99) flush(99,iostat=3Di,iomsg=3Derr) print *, i, err print *, IOSTAT_EOR , IOSTAT_END=20 end=