Peter Klausler a55e30b12c
[flang][runtime] Control stream truncation via runtime environment (#168415)
The ISO Fortran standards don't say whether a WRITE to a formatted
stream unit should truncate the unit if there has been any repositioning
(via POS= control list specifiers) to an earlier point in the stream.
But units with sequential records do truncate on writes after BACKSPACE
and REWIND statements, and many compilers (including this one) truncate
stream units too. Since some compilers don't truncate streams, this
patch adds an environment variable FORT_TRUNCATE_STREAM that can be set
to 0 to disable truncation and ease porting to flang-new of codes that
depend on that behavior.

Fixes https://github.com/llvm/llvm-project/issues/167569.
2025-11-19 08:54:43 -08:00
..
2024-05-15 13:10:16 +01:00
2024-12-18 07:02:37 -08:00