[flang-commits] [PATCH] D83140: [flang] Define new runtime error IOSTAT values (I/O runtime work part 4)

Peter Klausler via Phabricator via flang-commits flang-commits at lists.llvm.org
Fri Jul 3 11:17:25 PDT 2020


klausler created this revision.
klausler added reviewers: tskeith, sscalpone.
klausler added a project: Flang.
Herald added a reviewer: jdoerfert.
Herald added a reviewer: DavidTruby.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Add more IOSTAT= values for errors that can arise in external I/O.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D83140

Files:
  flang/runtime/iostat.cpp
  flang/runtime/iostat.h


Index: flang/runtime/iostat.h
===================================================================
--- flang/runtime/iostat.h
+++ flang/runtime/iostat.h
@@ -45,6 +45,16 @@
   IostatInternalWriteOverrun,
   IostatErrorInFormat,
   IostatErrorInKeyword,
+  IostatEndfileNonSequential,
+  IostatEndfileUnwritable,
+  IostatOpenBadRecl,
+  IostatOpenUnknownSize,
+  IostatOpenBadAppend,
+  IostatWriteToReadOnly,
+  IostatReadFromWriteOnly,
+  IostatBackspaceNonSequential,
+  IostatBackspaceAtFirstRecord,
+  IostatRewindNonSequential,
 };
 
 const char *IostatErrorString(int);
Index: flang/runtime/iostat.cpp
===================================================================
--- flang/runtime/iostat.cpp
+++ flang/runtime/iostat.cpp
@@ -33,6 +33,26 @@
     return "Invalid FORMAT";
   case IostatErrorInKeyword:
     return "Bad keyword argument value";
+  case IostatEndfileNonSequential:
+    return "ENDFILE on non-sequential file";
+  case IostatEndfileUnwritable:
+    return "ENDFILE on read-only file";
+  case IostatOpenBadRecl:
+    return "OPEN with bad RECL= value";
+  case IostatOpenUnknownSize:
+    return "OPEN of file of unknown size";
+  case IostatOpenBadAppend:
+    return "OPEN(POSITION='APPEND') of unpositionable file";
+  case IostatWriteToReadOnly:
+    return "Attempted output to read-only file";
+  case IostatReadFromWriteOnly:
+    return "Attempted input from write-only file";
+  case IostatBackspaceNonSequential:
+    return "BACKSPACE on non-sequential file";
+  case IostatBackspaceAtFirstRecord:
+    return "BACKSPACE at first record";
+  case IostatRewindNonSequential:
+    return "REWIND on non-sequential file";
   default:
     return nullptr;
   }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D83140.275436.patch
Type: text/x-patch
Size: 1693 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20200703/1a702fdc/attachment-0001.bin>


More information about the flang-commits mailing list