[libc-commits] [libc] [libc] Fix -Wshadow warning in IntegrationTest/test.cpp (PR #196858)
Nico Weber via libc-commits
libc-commits at lists.llvm.org
Sun May 10 17:42:00 PDT 2026
https://github.com/nico created https://github.com/llvm/llvm-project/pull/196858
None
>From e604f1a38974f545927a864d42d7601fc3ec433b Mon Sep 17 00:00:00 2001
From: Nico Weber <thakis at chromium.org>
Date: Sun, 10 May 2026 20:07:34 -0400
Subject: [PATCH] [libc] Fix -Wshadow warning in IntegrationTest/test.cpp
---
libc/test/IntegrationTest/test.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libc/test/IntegrationTest/test.cpp b/libc/test/IntegrationTest/test.cpp
index 19eb255e57b04..0a9728f021e90 100644
--- a/libc/test/IntegrationTest/test.cpp
+++ b/libc/test/IntegrationTest/test.cpp
@@ -66,12 +66,12 @@ int atexit(void (*func)(void)) { return LIBC_NAMESPACE::atexit(func); }
static constexpr uint64_t ALIGNMENT = alignof(double);
static constexpr uint64_t MEMORY_SIZE = 256 * 1024 /* 256 KiB */;
alignas(ALIGNMENT) static uint8_t memory[MEMORY_SIZE];
-static size_t ptr = 0;
+static size_t global_ptr = 0;
extern "C" {
void *malloc(size_t size) {
- LIBC_NAMESPACE::cpp::AtomicRef<size_t> ref(ptr);
+ LIBC_NAMESPACE::cpp::AtomicRef<size_t> ref(global_ptr);
size = (size + ALIGNMENT - 1) & ~(ALIGNMENT - 1);
size_t old_ptr =
ref.fetch_add(size, LIBC_NAMESPACE::cpp::MemoryOrder::RELAXED);
More information about the libc-commits
mailing list