[all-commits] [llvm/llvm-project] 5f4e81: [libc] Complete hardening of time functions and re...
Jeff Bailey via All-commits
all-commits at lists.llvm.org
Thu Jun 11 12:36:03 PDT 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 5f4e81c81be73304ae2dd87da366aac11debd9df
https://github.com/llvm/llvm-project/commit/5f4e81c81be73304ae2dd87da366aac11debd9df
Author: Jeff Bailey <jbailey at raspberryginger.com>
Date: 2026-06-11 (Thu, 11 Jun 2026)
Changed paths:
M libc/src/time/CMakeLists.txt
M libc/src/time/asctime.cpp
M libc/src/time/asctime_r.cpp
M libc/src/time/ctime.cpp
M libc/src/time/ctime_r.cpp
M libc/src/time/gmtime.cpp
M libc/src/time/gmtime_r.cpp
M libc/src/time/localtime.cpp
M libc/src/time/localtime_r.cpp
M libc/src/time/mktime.cpp
M libc/src/time/strftime.cpp
M libc/src/time/strftime_core/CMakeLists.txt
M libc/src/time/strftime_core/composite_converter.h
M libc/src/time/strftime_core/converter.h
M libc/src/time/strftime_core/num_converter.h
M libc/src/time/strftime_core/str_converter.h
M libc/src/time/strftime_l.cpp
M libc/src/time/time_utils.cpp
M libc/src/time/time_utils.h
M libc/test/src/time/asctime_r_test.cpp
M libc/test/src/time/asctime_test.cpp
M libc/test/src/time/ctime_r_test.cpp
M libc/test/src/time/ctime_test.cpp
M libc/test/src/time/gmtime_r_test.cpp
M libc/test/src/time/gmtime_test.cpp
M libc/test/src/time/localtime_r_test.cpp
M libc/test/src/time/localtime_test.cpp
M libc/test/src/time/mktime_test.cpp
Log Message:
-----------
[libc] Complete hardening of time functions and remove Y2038 limit (#203298)
Completed safety and hardening refactoring for time functions, and
removed Y2038 limitation:
* Hardening: Refactored update_from_seconds to return ErrorOr<int>
(instead of int64_t status, as it only returns status 0 or error)
and propagated it to entrypoints. Added LIBC_CRASH_ON_NULLPTR to public
boundaries and converted tests to death tests using SIGILL.
* Y2038: Removed the artificial int32_t max check from ctime and
ctime_r, allowing them to support timestamps beyond 2038 (up to Year
9999).
* Tests: Updated ctime/ctime_r tests to include Year 2039 test cases and
updated overflow test cases to Year 10000.
* Style: Fixed header blocks and added Doxygen comments in converter.h,
str_converter.h, and time_utils.h.
* Conventions: Fixed relative includes in converter.h and time_utils.h.
Assisted-by: Automated tooling, human reviewed.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list