[libc-commits] [libc] [libc] Fix {asc, c, gm, mk}time(_r)? tests and spurios snprintf call (PR #216423)

via libc-commits libc-commits at lists.llvm.org
Sat Aug 15 15:59:33 PDT 2026


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff origin/main HEAD --extensions cpp,h -- libc/src/time/asctime_utils.h libc/src/time/asctime.cpp libc/src/time/asctime_r.cpp libc/src/time/ctime.cpp libc/src/time/ctime_r.cpp libc/src/time/time_utils.h --diff_from_common_commit
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/libc/src/time/asctime_utils.h b/libc/src/time/asctime_utils.h
index f187e1489..2fc6d4bf9 100644
--- a/libc/src/time/asctime_utils.h
+++ b/libc/src/time/asctime_utils.h
@@ -46,8 +46,7 @@ LIBC_INLINE ErrorOr<char *> asctime(const tm *timeptr, char *buffer,
                                      bufferLength > 0 ? bufferLength - 1 : 0);
   printf_core::Writer writer(wb);
 
-  auto res =
-      strftime_core::strftime_main(&writer, "%a %b %e %T %Y\n", timeptr);
+  auto res = strftime_core::strftime_main(&writer, "%a %b %e %T %Y\n", timeptr);
   if (!res.has_value())
     return cpp::unexpected(res.error());
 

``````````

</details>


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


More information about the libc-commits mailing list