[clang] [clang] replaced the usage of `asctime` with `strftime` (PR #99075)

via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 17 06:52:31 PDT 2024


cor3ntin wrote:

`asctime` is deprecated. But `asctime_s` is not.
See https://en.cppreference.com/w/c/chrono/asctime

using `strftime` is going to be challenging because of locale (ie we would have to temporarily switch to a C locale - both because we want a locale independent behavior, and because for an arbitrary locale the buffer might need to be bigger than for the C locale.

(an alternative would be to use the C++ interface https://compiler-explorer.com/z/WEqTW341b )

Either way, we need to make sure sure the produced string are identical, I'm sure people rely on that.




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


More information about the cfe-commits mailing list