[libc-commits] [libc] [libc] implement mkstemp (PR #199220)

via libc-commits libc-commits at lists.llvm.org
Sat Jun 6 21:07:10 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 h,cpp -- libc/src/stdlib/mkstemp.cpp libc/src/stdlib/mkstemp.h libc/test/src/stdlib/mkstemp_test.cpp --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/stdlib/mkstemp.cpp b/libc/src/stdlib/mkstemp.cpp
index 5d558ed50..3fb0d9021 100644
--- a/libc/src/stdlib/mkstemp.cpp
+++ b/libc/src/stdlib/mkstemp.cpp
@@ -51,7 +51,8 @@ LLVM_LIBC_FUNCTION(int, mkstemp, (char *tmpl)) {
   char *suffix = tmpl + len - count;
 
   // POSIX portable filename character set, sorted by ASCII value.
-  // See https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/V1_chap03.html#tag_03_265
+  // See
+  // https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/V1_chap03.html#tag_03_265
   const char charset[] = "-._0123456789"
                          "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
                          "abcdefghijklmnopqrstuvwxyz";
diff --git a/libc/test/src/stdlib/mkstemp_test.cpp b/libc/test/src/stdlib/mkstemp_test.cpp
index b63f270c4..09b472681 100644
--- a/libc/test/src/stdlib/mkstemp_test.cpp
+++ b/libc/test/src/stdlib/mkstemp_test.cpp
@@ -15,9 +15,9 @@
 #include "hdr/errno_macros.h"
 #include "hdr/fcntl_macros.h"
 #include "hdr/signal_macros.h"
-#include "src/string/strlen.h"
 #include "src/stdlib/mkstemp.h"
 #include "src/string/strdup.h"
+#include "src/string/strlen.h"
 #include "src/unistd/access.h"
 #include "src/unistd/close.h"
 #include "src/unistd/read.h"
@@ -66,7 +66,8 @@ TEST_F(LlvmLibcMkstempTest, AllCharactersInCharset) {
   int fd = LIBC_NAMESPACE::mkstemp(tmpl);
   ASSERT_GE(fd, 0);
   // POSIX portable filename character set, sorted by ASCII value.
-  // See https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/V1_chap03.html#tag_03_265
+  // See
+  // https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/V1_chap03.html#tag_03_265
   const char charset[] = "-._0123456789"
                          "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
                          "abcdefghijklmnopqrstuvwxyz";

``````````

</details>


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


More information about the libc-commits mailing list