[flang-commits] [flang] [flang] add SYSTEM runtime and lowering intrinsics support (PR #74309)

Peter Klausler via flang-commits flang-commits at lists.llvm.org
Wed Dec 6 07:10:49 PST 2023


================
@@ -282,4 +282,23 @@ std::int32_t RTNAME(GetEnvVariable)(const Descriptor &name,
   return StatOk;
 }
 
+void RTNAME(System)(const Descriptor *command, const Descriptor *exitstat,
+    const char *sourceFile, int line) {
+  Terminator terminator{sourceFile, line};
+
+  if (command) {
+    RUNTIME_CHECK(terminator, IsValidCharDescriptor(command));
+    int status{std::system(command->OffsetElement())};
----------------
klausler wrote:

How do you ensure that the Fortran character value passed to `system` is properly NUL-terminated?

https://github.com/llvm/llvm-project/pull/74309


More information about the flang-commits mailing list