From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id CF4343857733; Sat, 15 Apr 2023 03:31:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CF4343857733 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1681529498; bh=+vagpSHunNITPFjGrax8TGxaiVxtKQsL4qW8mQ8dzfc=; h=From:To:Subject:Date:In-Reply-To:References:From; b=KuVPwbnSeNk1Mt548qE1ZOc9VG5/LDcKfV7bs6p/24+P98FN4LhX1DKWUw2gI4d3/ Acs77IDwKGWfx0VuHCitXjXl+ol+sLDhJqFXdpi1etsUMcTa39iKIDJlZb78HWGZGA 3idZCLAZy1M7VJ63bU8rLqlWaql9z8ljlq193wGQ= From: "jvdelisle at gcc dot 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 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Version: 12.2.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jvdelisle at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: jvdelisle at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D109358 --- Comment #4 from Jerry DeLisle --- 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/54= 66/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 struct= ure to keep track in the stream where the end of the last "record" occurred. No= w 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 explici= tly 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 thi= s, but I do not want to waste my time with explicit things. Why? The real purp= ose of STREAM was suppose to be, in my mind, a way to write a binary stream irrespective of formatting. (sigh) More as I proceed.=