[libc-commits] [libc] lsearch_test.cpp: put helpers in anonymous namespace. (PR #137964)

via libc-commits libc-commits at lists.llvm.org
Wed Apr 30 06:55:11 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libc

Author: None (enh-google)

<details>
<summary>Changes</summary>



---
Full diff: https://github.com/llvm/llvm-project/pull/137964.diff


1 Files Affected:

- (modified) libc/test/src/search/lsearch_test.cpp (+4) 


``````````diff
diff --git a/libc/test/src/search/lsearch_test.cpp b/libc/test/src/search/lsearch_test.cpp
index 9e58b87772c3b..864e3ecc21a08 100644
--- a/libc/test/src/search/lsearch_test.cpp
+++ b/libc/test/src/search/lsearch_test.cpp
@@ -9,10 +9,14 @@
 #include "src/search/lsearch.h"
 #include "test/UnitTest/Test.h"
 
+namespace {
+
 int compar(const void *a, const void *b) {
   return *reinterpret_cast<const int *>(a) != *reinterpret_cast<const int *>(b);
 }
 
+} // namespace
+
 TEST(LlvmLibcLsearchTest, SearchHead) {
   int list[3] = {1, 2, 3};
   size_t len = 3;

``````````

</details>


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


More information about the libc-commits mailing list