This is an archive of the discontinued LLVM Phabricator instance.

[flang] OPEN(RECL=) handling for sequential formatted I/O
ClosedPublic

Authored by klausler on Dec 4 2021, 11:37 AM.

Details

Summary

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.

Diff Detail

Event Timeline

klausler created this revision.Dec 4 2021, 11:37 AM
klausler requested review of this revision.Dec 4 2021, 11:37 AM
vdonaldson accepted this revision.Dec 4 2021, 11:41 AM
This revision is now accepted and ready to land.Dec 4 2021, 11:41 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptDec 4 2021, 4:03 PM