[flang-commits] [flang] FDATE extension implementation: get date and time in ctime format (PR #71222)

Yi Wu via flang-commits flang-commits at lists.llvm.org
Fri Nov 10 08:19:16 PST 2023


================
@@ -125,6 +142,36 @@ static bool FitsInDescriptor(
       kind, terminator, value);
 }
 
+void removeNewLine(char *str) {
+  char *newlinePos = std::strchr(str, '\n');
+  if (newlinePos) {
+    *newlinePos = '\0'; // Replace with null terminator
+  }
+}
+
+std::int32_t RTNAME(FDate)(const Descriptor *value, const Descriptor *errmsg) {
+  FillWithSpaces(*value);
----------------
PAX-12-WU wrote:

never mind, it won't be a problem when I move in to `extension.cpp`. (have it implemented there, instead of calling a runtime function). and its probably the place where it should be. It is a `GNU extension` rather than a `standard extension`.
https://gcc.gnu.org/onlinedocs/gfortran/FDATE.html

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


More information about the flang-commits mailing list