[all-commits] [llvm/llvm-project] 348d23: [libc++][chrono] Initialize optional tm_zone membe...

Nick Desaulniers via All-commits all-commits at lists.llvm.org
Mon Sep 28 13:27:34 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 348d23c3b238016836d84ba30aa573ba3a39649d
      https://github.com/llvm/llvm-project/commit/348d23c3b238016836d84ba30aa573ba3a39649d
  Author: Nick Desaulniers <ndesaulniers at google.com>
  Date:   2026-09-28 (Mon, 28 Sep 2026)

  Changed paths:
    M libcxx/include/__chrono/convert_to_tm.h

  Log Message:
  -----------
  [libc++][chrono] Initialize optional tm_zone member in __convert_to_tm (#220068)

Defensively initialize `struct tm`'s optional `tm_zone` member in
`__convert_to_tm` before passing it to `strftime` or `time_put`.
    
`tm_zone` is a BSD extension standardized in POSIX.1-2024, but is not
part
of standard C or C++ (and is absent on Windows). Instead of guarding
with
`#ifdef __GLIBC__`, use `if constexpr (requires ...)` so it is
initialized
on all platforms that provide it (such as Bionic, musl, macOS, and BSDs,
whether typed as `const char*` or `char*`).
    
Assisted-by: Gemini



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