public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "kargl at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/101255] FLUSH statement - error should be negative Date: Thu, 01 Jul 2021 20:12:49 +0000 [thread overview] Message-ID: <bug-101255-4-4zHx9FD2wd@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-101255-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101255 kargl at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kargl at gcc dot gnu.org Priority|P3 |P4 --- Comment #1 from kargl at gcc dot gnu.org --- (In reply to Tobias Burnus from comment #0) > 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 diff --git a/libgfortran/io/file_pos.c b/libgfortran/io/file_pos.c index 7e71ca577e0..4ed1698f17a 100644 --- a/libgfortran/io/file_pos.c +++ b/libgfortran/io/file_pos.c @@ -527,7 +527,7 @@ st_flush (st_parameter_filepos *fpp) } else /* FLUSH on unconnected unit is illegal: F95 std., 9.3.5. */ - generate_error (&fpp->common, LIBERROR_BAD_OPTION, + generate_error (&fpp->common, -LIBERROR_BAD_UNIT, "Specified UNIT in FLUSH is not connected"); if (needs_unlock)
next prev parent reply other threads:[~2021-07-01 20:12 UTC|newest] Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-06-29 11:09 [Bug fortran/101255] New: " burnus at gcc dot gnu.org 2021-07-01 20:12 ` kargl at gcc dot gnu.org [this message] 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
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-101255-4-4zHx9FD2wd@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).