llvm/flang/docs
peter klausler 4d42e16eb8 [flang] runtime: fix problems with I/O around EOF & delimited characters
When a WRITE overwrites an endfile record, we need to forget
that there was an endfile record.  When doing a BACKSPACE
after an explicit ENDFILE statement, the position afterwards
must be upon the endfile record.

Attempts to join list-directed delimited character input across
record boundaries was due to a bad reading of the standard
and has been deleted, now that the requirements are better understood.
This problem would cause a read attempt past EOF if a delimited
character input value was at the end of a record.

It turns out that delimited list-directed (and NAMELIST) character
output is required to emit contiguous doubled instances of the
delimiter character when it appears in the output value.  When
fixed-size records are being emitted, as is the case with internal
output, this is not possible when the problematic character falls
on the last position of a record.  No two other Fortran compilers
do the same thing in this situation so there is no good precedent
to follow.

Because it seems least wrong, with this patch we now emit one copy
of the delimiter as the last character of the current record and
another as the first character of the next record.  (The
second-least-wrong alternative might be to flag a runtime error,
but that seems harsh since it's not an explicit error in the standard,
and the output may not have to be usable later as input anyway.)
Consequently, the output is not suitable for use as list-directed or
NAMELIST input.

If a later standard were to clarify this case, this behavior will of
course change as needed to conform.

Differential Revision: https://reviews.llvm.org/D106695
2021-07-23 18:23:26 -07:00
..
_static
_templates
_themes/llvm-theme
ArrayComposition.md
BijectiveInternalNameUniquing.md
C++17.md
C++style.md [flang] Add clang-tidy check for braces around if 2021-06-16 09:13:53 +00:00
Calls.md
Character.md
CMakeLists.txt
conf.py
ControlFlowGraph.md
Directives.md
DoConcurrent.md
doxygen-mainpage.dox
doxygen.cfg.in
Extensions.md [flang] runtime: fix problems with I/O around EOF & delimited characters 2021-07-23 18:23:26 -07:00
f2018-grammar.md
flang-c-style.el
FlangDriver.md [flang][docs] Add documentation for the new Flang driver 2021-07-01 08:14:54 +00:00
FortranFeatureHistory.md
FortranForCProgrammers.md
FortranIR.md
FortranLLVMTestSuite.md [flang][docs] Minor update to Fortran LLVM Tests-suite docs. 2021-06-28 10:01:29 -05:00
GettingInvolved.md [Flang][Docs] Update meeting URL 2021-07-07 10:35:35 -05:00
ImplementingASemanticCheck.md
index.md
Intrinsics.md
IORuntimeInternals.md
LabelResolution.md
ModFiles.md
OpenMP-4.5-grammar.md
OpenMP-semantics.md
OptionComparison.md
Overview.md
ParserCombinators.md
Parsing.md
Preprocessing.md
PullRequestChecklist.md
ReleaseNotes.md
RuntimeDescriptor.md
RuntimeTypeInfo.md
Semantics.md