Skip to content

Commit 3df9c29

Browse files
ilvokhinldionne
authored andcommitted
[libc++] Fix minor warnings in libcxx benchmarks
This fixes some unused variable and "comparison of integers of different signs" warnings in the benchmarks. Differential Revision: https://reviews.llvm.org/D156613
1 parent d5cc372 commit 3df9c29

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

libcxx/benchmarks/allocation.bench.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ static void BM_DeallocateOnly(benchmark::State& st) {
7676
p = AllocWrapper::Allocate(alloc_size);
7777
}
7878

79-
void** Data = Pointers.data();
80-
void** const End = Pointers.data() + Pointers.size();
79+
void** Data = Pointers.data();
80+
[[maybe_unused]] void** const End = Pointers.data() + Pointers.size();
8181
while (st.KeepRunning()) {
8282
AllocWrapper::Deallocate(*Data, alloc_size);
8383
Data += 1;

libcxx/benchmarks/monotonic_buffer.bench.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ static void bm_list(benchmark::State& state) {
1616
std::pmr::monotonic_buffer_resource resource(buffer, sizeof(buffer));
1717
for (auto _ : state) {
1818
std::pmr::list<int> l(&resource);
19-
for (size_t i = 0; i != state.range(); ++i) {
19+
for (int64_t i = 0; i != state.range(); ++i) {
2020
l.push_back(1);
2121
benchmark::DoNotOptimize(l);
2222
}

0 commit comments

Comments
 (0)