[libc-commits] [libc] change the return value type of mktime_internal to time_t (PR #132231)

via libc-commits libc-commits at lists.llvm.org
Sun Mar 23 09:17:18 PDT 2025


================
@@ -102,11 +103,11 @@ int64_t mktime_internal(const tm *tm_out) {
 
   // TODO: https://github.com/llvm/llvm-project/issues/121962
   // Need to handle timezone and update of tm_isdst.
-  int64_t seconds = tm_out->tm_sec +
-                    tm_out->tm_min * time_constants::SECONDS_PER_MIN +
-                    tm_out->tm_hour * time_constants::SECONDS_PER_HOUR +
-                    total_days * time_constants::SECONDS_PER_DAY;
-  return seconds;
+  time_t seconds = tm_out->tm_sec +
+                   tm_out->tm_min * time_constants::SECONDS_PER_MIN +
+                   tm_out->tm_hour * time_constants::SECONDS_PER_HOUR +
+                   total_days * time_constants::SECONDS_PER_DAY;
+  return {seconds};
----------------
wsehjk wrote:

Yeah, you are right. I will remve braces. But what is `cpp::nullpt_t`?

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


More information about the libc-commits mailing list