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/65684] Wrong error message when writing to a string Date: Tue, 07 Apr 2015 16:24:00 -0000 [thread overview] Message-ID: <bug-65684-4-xnY4QntbVT@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-65684-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65684 kargl at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kargl at gcc dot gnu.org --- Comment #2 from kargl at gcc dot gnu.org --- Your program is non-conforming. Technically, gfortran can do anything. This includes not issuing any error message, starting World War III, or issuing an error message. In fact, gfortran's error message is correct to extent that the write statement reaches the end-of-record. If one takes the time to wander through the final committee draft of the Fortran 2008 standard, then one can piece together the story. The crucial text is the third bullet under Sec. 9.4. 9.2 Records 9.2.1 General A record is a sequence of values or a sequence of characters. 9.4 Internal files An internal file is a record file with the following properties. * A record of an internal file is a scalar character variable. * If the file is a scalar character variable, it consists of a single record whose length is the same as the length of the scalar character variable. * A record of the internal file becomes defined by writing the record. If the number of characters written in a record is less than the length of the record, the remaining portion of the record is filled with blanks. The number of characters to be written shall not exceed the length of the record. 9.6.4 Execution of a data transfer input/output statement 9.6.4.1 General .... (7) Determine whether an error, end-of-file, or end-of-record condition has occurred. .... (10) If an error, end-of-file, or end-of-record condition occurred, processing continues as specified in 9.11; otherwise any variable specified in an IOSTAT= specifier is assigned the value zero. 9.11.4 End-of-record condition and the EOR= specifier If an end-of-record condition occurs during execution of an input/output statement that contains neither an EOR= specifier nor an IOSTAT= specifier, error termination is initiated. IMNSHO, this bug report should be closed as WONTFIX, but I'll leave it open until others have a chance to comment.
next prev parent reply other threads:[~2015-04-07 16:24 UTC|newest] Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top 2015-04-07 11:27 [Bug fortran/65684] New: " a.vogt at fulguritus dot com 2015-04-07 11:29 ` [Bug fortran/65684] " a.vogt at fulguritus dot com 2015-04-07 16:24 ` kargl at gcc dot gnu.org [this message] 2015-04-07 16:47 ` a.vogt at fulguritus dot com 2015-04-07 19:07 ` jvdelisle at gcc dot gnu.org 2015-04-08 9:02 ` dominiq at lps dot ens.fr 2015-04-08 9:23 ` a.vogt at fulguritus dot com 2015-04-08 9:46 ` dominiq at lps dot ens.fr 2015-04-08 10:21 ` a.vogt at fulguritus dot com 2015-04-08 18:38 ` a.vogt at fulguritus dot com 2015-04-09 12:24 ` jvdelisle at gcc dot gnu.org 2015-04-21 18:33 ` jvdelisle 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-65684-4-xnY4QntbVT@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).