Skip to content

Commit f6eda6f

Browse files
authored
[libc] Fix for unused variable warning (llvm#98086)
This fixes the `unused variable 'new_inner_size'` warning that arises when `new_inner_size` is only used by `LIBC_ASSERT` by performing the calculation directly in the macro.
1 parent 2a7abb0 commit f6eda6f

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

libc/src/__support/block.h

+1-2
Original file line numberDiff line numberDiff line change
@@ -442,8 +442,7 @@ Block<OffsetType, kAlign>::allocate(Block *block, size_t alignment,
442442

443443
if (!info.block->is_usable_space_aligned(alignment)) {
444444
size_t adjustment = info.block->padding_for_alignment(alignment);
445-
size_t new_inner_size = adjustment - BLOCK_OVERHEAD;
446-
LIBC_ASSERT(new_inner_size % ALIGNMENT == 0 &&
445+
LIBC_ASSERT((adjustment - BLOCK_OVERHEAD) % ALIGNMENT == 0 &&
447446
"The adjustment calculation should always return a new size "
448447
"that's a multiple of ALIGNMENT");
449448

0 commit comments

Comments
 (0)