[libc-commits] [libc] 99d40fe - [libc] Fix freelist_heap_test.cpp warnings

Daniel Thornburgh via libc-commits libc-commits at lists.llvm.org
Thu Jan 16 12:04:54 PST 2025


Author: Daniel Thornburgh
Date: 2025-01-16T12:04:44-08:00
New Revision: 99d40fe8f028efa32d31754be774a0d3a0d20fc7

URL: https://github.com/llvm/llvm-project/commit/99d40fe8f028efa32d31754be774a0d3a0d20fc7
DIFF: https://github.com/llvm/llvm-project/commit/99d40fe8f028efa32d31754be774a0d3a0d20fc7.diff

LOG: [libc] Fix freelist_heap_test.cpp warnings

Added: 
    

Modified: 
    libc/test/src/__support/freelist_heap_test.cpp

Removed: 
    


################################################################################
diff  --git a/libc/test/src/__support/freelist_heap_test.cpp b/libc/test/src/__support/freelist_heap_test.cpp
index a3d4713e89e44e..0623272dd5b9fe 100644
--- a/libc/test/src/__support/freelist_heap_test.cpp
+++ b/libc/test/src/__support/freelist_heap_test.cpp
@@ -100,7 +100,7 @@ TEST(LlvmLibcFreeListHeap, ReturnsNullWhenFull) {
   FreeListHeap allocator(buf);
 
   bool went_null = false;
-  for (int i = 0; i < N; i++) {
+  for (size_t i = 0; i < N; i++) {
     if (!allocator.allocate(1)) {
       went_null = true;
       break;
@@ -246,7 +246,6 @@ TEST_FOR_EACH_ALLOCATOR(AlignedAlloc, 2048) {
 // still get aligned allocations even if the underlying buffer is not aligned to
 // the alignments we request.
 TEST(LlvmLibcFreeListHeap, AlignedAllocUnalignedBuffer) {
-  constexpr size_t BUFFER_SIZE = 4096;
   byte buf[4096] = {byte(0)};
 
   // Ensure the underlying buffer is poorly aligned.


        


More information about the libc-commits mailing list