[all-commits] [llvm/llvm-project] 06ca9f: [flang] OPEN(RECL=) handling for sequential format...

Peter Klausler via All-commits all-commits at lists.llvm.org
Sat Dec 4 16:03:15 PST 2021

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 06ca9f24e73fb1a9302830b4464493abd38425d0
  Author: Peter Klausler <pklausler at nvidia.com>
  Date:   2021-12-04 (Sat, 04 Dec 2021)

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

  Log Message:
  [flang] OPEN(RECL=) handling for sequential formatted I/O

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.

Differential Revision: https://reviews.llvm.org/D115102

More information about the All-commits mailing list