[libc-commits] [libc] [libc] lfind_test.cpp: put helpers in an anonymous namespace. (PR #137821)

Joseph Huber via libc-commits libc-commits at lists.llvm.org
Tue Apr 29 08:24:26 PDT 2025


================
@@ -9,10 +9,14 @@
 #include "src/search/lfind.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);
 }
 
+}
+
----------------
jhuber6 wrote:

```suggestion
static int compar(const void *a, const void *b) {
  return *reinterpret_cast<const int *>(a) != *reinterpret_cast<const int *>(b);
}
```
Honestly, this is more in-line with LLVM's coding style, but I don't know how much `libc` differs.

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


More information about the libc-commits mailing list