Skip to content

Commit

Permalink
[libc] Move statement inside #ifdef/#endif to prevent unused variable…
Browse files Browse the repository at this point in the history
… warning

This is a fix forward for arm32
`/llvm/libc_worker/worker/libc-arm32-debian/libc-arm32-debian-dbg/llvm-project/libc/src/__support/big_int.h:259:20: error: unused variable 'TOTAL_BITS' [-Werror,-Wunused-variable]`

https://lab.llvm.org/buildbot/#/builders/229/builds/24791
  • Loading branch information
gchatelet authored Apr 6, 2024
1 parent 7f9f82e commit bd589f5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libc/src/__support/big_int.h
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,8 @@ LIBC_INLINE constexpr cpp::array<word, N> shift(cpp::array<word, N> array,
size_t offset) {
static_assert(direction == LEFT || direction == RIGHT);
constexpr size_t WORD_BITS = cpp::numeric_limits<word>::digits;
constexpr size_t TOTAL_BITS = N * WORD_BITS;
#ifdef LIBC_TYPES_HAS_INT128
constexpr size_t TOTAL_BITS = N * WORD_BITS;
if constexpr (TOTAL_BITS == 128) {
using type = cpp::conditional_t<is_signed, __int128_t, __uint128_t>;
auto tmp = cpp::bit_cast<type>(array);
Expand Down

0 comments on commit bd589f5

Please sign in to comment.