public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/101255] New: FLUSH statement - error should be negative
@ 2021-06-29 11:09 burnus at gcc dot gnu.org
  2021-07-01 20:12 ` [Bug fortran/101255] " kargl at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: burnus at gcc dot gnu.org @ 2021-06-29 11:09 UTC (permalink / raw)
  To: gcc-bugs

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

            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= 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          
          -2          -1
shouldn't the 5002 be a negative number (such as -5002)?

use iso_fortran_env
implicit none
character(len=50) :: err
integer :: i
!open(99)
!close(99)
flush(99,iostat=i,iomsg=err)
print *, i, err
print *, IOSTAT_EOR , IOSTAT_END 
end

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-12-16 16:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-29 11:09 [Bug fortran/101255] New: FLUSH statement - error should be negative burnus at gcc dot gnu.org
2021-07-01 20:12 ` [Bug fortran/101255] " kargl at gcc dot gnu.org
2021-07-18 20:22 ` [Bug libfortran/101255] " anlauf at gcc dot gnu.org
2021-12-16 16:49 ` fxcoudert at gcc dot gnu.org

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).