public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jvdelisle at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/109358] Wrong formatting with T-descriptor during stream output
Date: Sat, 15 Apr 2023 03:31:38 +0000	[thread overview]
Message-ID: <bug-109358-4-sLNWo1yeHa@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-109358-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #4 from Jerry DeLisle <jvdelisle at gcc dot gnu.org> ---
Well this is getting quite interesting. There is a bit of discussion going on
the Fortran Discourse about this.

https://fortran-lang.discourse.group/t/tab-formatting-with-stream-access/5466/47

After thinking about this a lot and going back in my mind to the beginning, we
had no concept of a "STREAM" file having a "record". In fact we never even try
to track where the end of a record may be. So my thoughts are is when doing
formatted "STREAM" writes I can introduce a variable in the gfc_unit structure
to keep track in the stream where the end of the last "record" occurred. Now by
"record" this would be either when a /n or /n/r ocurred.  You can think of a
complication where someone just decides to write out a /n or a /n/r explicitly
not using NEWLINE and not using the implicit EOR that happens with every
formatted write statement.

So I begin to believe this is a conceptual error in the standard. The fact that
there is such discussion about it implies that it is a conceptual error.

Regardless, I think I can handle the implicit EOR that occurs and track this,
but I do not want to waste my time with explicit things. Why? The real purpose
of STREAM was suppose to be, in my mind, a way to write a binary stream
irrespective of formatting.

(sigh)

More as I proceed.

  parent reply	other threads:[~2023-04-15  3:31 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-31 10:49 [Bug fortran/109358] New: " baradi09 at gmail dot com
2023-03-31 20:27 ` [Bug fortran/109358] " jvdelisle at gcc dot gnu.org
2023-04-06  2:48 ` jvdelisle at gcc dot gnu.org
2023-04-06  3:56 ` kargl at gcc dot gnu.org
2023-04-15  3:31 ` jvdelisle at gcc dot gnu.org [this message]
2023-04-16  8:18 ` baradi09 at gmail dot com
2023-06-02  1:51 ` jvdelisle at gcc dot gnu.org
2023-06-02  5:17 ` sgk at troutmask dot apl.washington.edu
2024-02-03 18:28 ` jvdelisle at gcc dot gnu.org
2024-02-08 18:14 ` jvdelisle at gcc dot gnu.org
2024-02-08 18:17 ` jvdelisle at gcc dot gnu.org
2024-02-12 20:05 ` jvdelisle at gcc dot gnu.org
2024-02-12 23:30 ` cvs-commit at gcc dot gnu.org
2024-02-13  3:26 ` cvs-commit at gcc dot gnu.org
2024-02-14 19:58 ` jvdelisle at gcc dot gnu.org
2024-02-17 20:16 ` anlauf at gcc dot gnu.org
2024-02-19  2:38 ` 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-109358-4-sLNWo1yeHa@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: link
Be 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).