[libc-commits] [libc] [libc] Implement basename and dirname in libgen.h (PR #204554)

via libc-commits libc-commits at lists.llvm.org
Thu Jun 18 09:34: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 h,cpp -- libc/src/libgen/basename.cpp libc/src/libgen/basename.h libc/src/libgen/dirname.cpp libc/src/libgen/dirname.h libc/test/src/libgen/basename_test.cpp libc/test/src/libgen/dirname_test.cpp libc/src/__support/CPP/string_view.h libc/test/UnitTest/PlatformDefs.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/test/UnitTest/PlatformDefs.h b/libc/test/UnitTest/PlatformDefs.h
index 72ee3d330..294a12b70 100644
--- a/libc/test/UnitTest/PlatformDefs.h
+++ b/libc/test/UnitTest/PlatformDefs.h
@@ -12,7 +12,7 @@
 #define LIBC_TEST_UNIT 1
 #define LIBC_TEST_HERMETIC 2
 
-#define CONCAT_HELPER(a, b) a ## b
+#define CONCAT_HELPER(a, b) a##b
 #define CONCAT(a, b) CONCAT_HELPER(a, b)
 
 #define CHECK_TEST_TYPE(type) CONCAT(LIBC_TEST_, type)

``````````

</details>


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


More information about the libc-commits mailing list