[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:54:36 PDT 2025


https://github.com/enh-google created https://github.com/llvm/llvm-project/pull/137964

None

>From d6db676e7a44ead64810ab96389391ad3218208b Mon Sep 17 00:00:00 2001
From: enh-google <enh at google.com>
Date: Wed, 30 Apr 2025 09:53:48 -0400
Subject: [PATCH] lsearch_test.cpp: put helpers in anonymous namespace.

---
 libc/test/src/search/lsearch_test.cpp | 4 ++++
 1 file changed, 4 insertions(+)

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;



More information about the libc-commits mailing list