[flang-commits] [PATCH] D115102: [flang] OPEN(RECL=) handling for sequential formatted I/O

Peter Klausler via Phabricator via flang-commits flang-commits at lists.llvm.org
Sat Dec 4 11:37:06 PST 2021


klausler created this revision.
klausler added a reviewer: vdonaldson.
klausler added a project: Flang.
Herald added a subscriber: jdoerfert.
klausler requested review of this revision.

RECL= is required for direct access I/O, but is permitted
as well for sequential I/O, where it is defined by the
standard to specify a maximum record (line) length.
The standard does not say what should happen when an
sequential formatted input record appears whose length is
unequal to RECL= when it is specified.

Precedents from other compilers are unclear: one raises an error,
some honor RECL= as an effective truncation, and a few ignore the
situation.  On output, all other compilers tested raised an
error when an attempt is made to emit a record longer than RECL=.

This patch treats RECL= as effective truncation on input and
as a hard limit with error on output, and also ensures that
RECL= can be set *longer* than the actual input record lengths.


https://reviews.llvm.org/D115102

Files:
  flang/docs/Extensions.md
  flang/runtime/connection.h
  flang/runtime/internal-unit.cpp
  flang/runtime/io-api.cpp
  flang/runtime/io-stmt.cpp
  flang/runtime/io-stmt.h
  flang/runtime/unit.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D115102.391849.patch
Type: text/x-patch
Size: 14539 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20211204/9a75afb3/attachment-0001.bin>


More information about the flang-commits mailing list