[libc-commits] [libc] [libc] Add tmpnam implementation (PR #204901)

via libc-commits libc-commits at lists.llvm.org
Sun Sep 6 00:46:21 PDT 2026


github-actions[bot] wrote:

<!--PREMERGE ADVISOR COMMENT: Linux-->
# :penguin: Linux x64 Test Results

The build failed before running any tests. Click on a failure below to see the details.

<details>
<summary>libc/test/src/stdio/CMakeFiles/libc.test.src.stdio.tmpnam_test.__build__.dir/tmpnam_test.cpp.o</summary>

```
FAILED: libc/test/src/stdio/CMakeFiles/libc.test.src.stdio.tmpnam_test.__build__.dir/tmpnam_test.cpp.o
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/./bin/clang++ --target=x86_64-unknown-linux-gnu -DLIBC_NAMESPACE=__llvm_libc_24_0_0_git -I/home/gha/actions-runner/_work/llvm-project/llvm-project/libc -I/home/gha/actions-runner/_work/llvm-project/llvm-project/build/runtimes/runtimes-bins/libc -isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/runtimes/runtimes-bins/libc/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wno-pass-failed -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -Xclang -fno-pch-timestamp -O3 -DNDEBUG -std=gnu++17 -UNDEBUG -D__LIBC_USE_BUILTIN_ISNAN -DLIBC_QSORT_IMPL=LIBC_QSORT_QUICK_SORT -DLIBC_COPT_STRING_LENGTH_IMPL=clang_vector -DLIBC_COPT_FIND_FIRST_CHARACTER_IMPL=word -DLIBC_COPT_MEMCPY_X86_USE_NTA_STORES -DLIBC_ADD_NULL_CHECKS -DLIBC_ERRNO_MODE=LIBC_ERRNO_MODE_DEFAULT -DLIBC_THREAD_MODE=LIBC_THREAD_MODE_PLATFORM -DLIBC_COPT_TIMEOUT_ENSURE_MONOTONICITY -DLIBC_CONF_WCTYPE_MODE=LIBC_WCTYPE_MODE_ASCII -DLIBC_COPT_RAW_MUTEX_DEFAULT_SPIN_COUNT=100 -DLIBC_COPT_HARDENING_MODE=LIBC_HARDENING_MODE_NONE -DLIBC_COPT_SCANF_PROVIDE_ISOC99_ALIASES -DLIBC_TEST_FLOAT_RANGE_COUNT=1231 -DLIBC_TEST_SUBPROCESS_TESTS=1 -fpie -ffixed-point -Wall -Wextra -Wconversion -Wno-sign-conversion -Wimplicit-fallthrough -Wwrite-strings -Wno-c99-extensions -Wno-gnu-imaginary-constant -Wno-pedantic -Wstrict-prototypes -Wextra-semi -Wnewline-eof -Wnonportable-system-include-path -Wthread-safety -DLIBC_COMPILER_HAS_STDC_FENV_ACCESS -MD -MT libc/test/src/stdio/CMakeFiles/libc.test.src.stdio.tmpnam_test.__build__.dir/tmpnam_test.cpp.o -MF libc/test/src/stdio/CMakeFiles/libc.test.src.stdio.tmpnam_test.__build__.dir/tmpnam_test.cpp.o.d -o libc/test/src/stdio/CMakeFiles/libc.test.src.stdio.tmpnam_test.__build__.dir/tmpnam_test.cpp.o -c /home/gha/actions-runner/_work/llvm-project/llvm-project/libc/test/src/stdio/tmpnam_test.cpp
/home/gha/actions-runner/_work/llvm-project/llvm-project/libc/test/src/stdio/tmpnam_test.cpp:56:3: error: no matching function for call to 'test'
56 |   ASSERT_EQ(sv.size(), L_tmpnam);
|   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/gha/actions-runner/_work/llvm-project/llvm-project/libc/test/UnitTest/LibcTest.h:449:29: note: expanded from macro 'ASSERT_EQ'
449 | #define ASSERT_EQ(LHS, RHS) LIBC_TEST_BINOP_(EQ, LHS, RHS, return)
|                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/gha/actions-runner/_work/llvm-project/llvm-project/libc/test/UnitTest/LibcTest.h:440:26: note: expanded from macro 'LIBC_TEST_BINOP_'
440 |   LIBC_TEST_SCAFFOLDING_(LIBC_NAMESPACE::testing::internal::test(              \
|   ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
441 |                              LIBC_NAMESPACE::testing::TestCond::COND, LHS,     \
|                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
442 |                              RHS, #LHS, #RHS, LIBC_TEST_LOC_()),               \
|                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
443 |                          RET_OR_EMPTY)
|                          ~~~~~~~~~~~~~
<command line>:1:24: note: expanded from macro 'LIBC_NAMESPACE'
1 | #define LIBC_NAMESPACE __llvm_libc_24_0_0_git
|                        ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/libc/test/UnitTest/LibcTest.h:433:7: note: expanded from macro 'LIBC_TEST_SCAFFOLDING_'
433 |   if (TEST)                                                                    \
|       ^~~~
/home/gha/actions-runner/_work/llvm-project/llvm-project/libc/test/UnitTest/LibcTest.h:114:6: note: candidate template ignored: deduced conflicting types for parameter 'ValType' ('size_t' (aka 'unsigned long') vs. 'int')
114 | bool test(TestCond Cond, ValType LHS, ValType RHS, const char *LHSStr,
|      ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/libc/test/UnitTest/LibcTest.h:120:6: note: candidate template ignored: deduced conflicting types for parameter 'ValType' ('size_t' (aka 'unsigned long') vs. 'int')
120 | bool test(TestCond Cond, ValType LHS, ValType RHS, const char *LHSStr,
|      ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/libc/test/UnitTest/LibcTest.h:128:6: note: candidate template ignored: deduced conflicting types for parameter 'ValType' ('size_t' (aka 'unsigned long') vs. 'int')
128 | bool test(TestCond Cond, ValType LHS, ValType RHS, const char *LHSStr,
|      ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/libc/test/UnitTest/LibcTest.h:146:6: note: candidate template ignored: deduced conflicting types for parameter 'ValType' ('size_t' (aka 'unsigned long') vs. 'int')
146 | bool test(TestCond Cond, ValType LHS, ValType RHS, const char *LHSStr,
|      ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/libc/test/UnitTest/LibcTest.h:155:6: note: candidate template ignored: deduced conflicting types for parameter 'ValType' ('size_t' (aka 'unsigned long') vs. 'int')
155 | bool test(TestCond Cond, ValType LHS, ValType RHS, const char *LHSStr,
|      ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/libc/test/UnitTest/LibcTest.h:163:6: note: candidate template ignored: deduced conflicting types for parameter 'ValType' ('size_t' (aka 'unsigned long') vs. 'int')
163 | bool test(TestCond Cond, ValType LHS, ValType RHS, const char *LHSStr,
|      ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/libc/test/UnitTest/LibcTest.h:137:6: note: candidate template ignored: substitution failure [with ValType = size_t]: implicit instantiation of undefined template '__llvm_libc_24_0_0_git::cpp::enable_if<false, unsigned long>'
137 | bool test(TestCond Cond, ValType LHS, cpp::nullptr_t, const char *LHSStr,
|      ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/libc/test/src/stdio/tmpnam_test.cpp:72:30: error: use of undeclared identifier 'TMPDIR'; did you mean 'TMP_DIR'?
72 |   ASSERT_TRUE(sv.starts_with(TMPDIR));
|                              ^~~~~~
|                              TMP_DIR
/home/gha/actions-runner/_work/llvm-project/llvm-project/libc/test/UnitTest/LibcTest.h:470:36: note: expanded from macro 'ASSERT_TRUE'
470 | #define ASSERT_TRUE(VAL) ASSERT_EQ(VAL, true)
|                                    ^~~
/home/gha/actions-runner/_work/llvm-project/llvm-project/libc/test/UnitTest/LibcTest.h:449:50: note: expanded from macro 'ASSERT_EQ'
449 | #define ASSERT_EQ(LHS, RHS) LIBC_TEST_BINOP_(EQ, LHS, RHS, return)
|                                                  ^~~
/home/gha/actions-runner/_work/llvm-project/llvm-project/libc/test/UnitTest/LibcTest.h:441:71: note: expanded from macro 'LIBC_TEST_BINOP_'
441 |                              LIBC_NAMESPACE::testing::TestCond::COND, LHS,     \
|                                                                       ^~~
/home/gha/actions-runner/_work/llvm-project/llvm-project/libc/test/UnitTest/LibcTest.h:433:7: note: expanded from macro 'LIBC_TEST_SCAFFOLDING_'
433 |   if (TEST)                                                                    \
|       ^~~~
/home/gha/actions-runner/_work/llvm-project/llvm-project/libc/test/src/stdio/tmpnam_test.cpp:25:23: note: 'TMP_DIR' declared here
25 | constexpr string_view TMP_DIR = "/tmp/";
|                       ^
2 errors generated.
```
</details>

If these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the `infrastructure` label.

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


More information about the libc-commits mailing list