-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Revert "[libc] Enable -Wconversion for tests. (#127523)" #129928
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@llvm/pr-subscribers-libc Author: Augie Fackler (durin42) ChangesThis reverts commit 1e6e845 because it changed the 1st parameter of adjust() to be unsigned, but libc itself calls adjust() with a negative argument in align_backward() in op_generic.h. Patch is 71.80 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/129928.diff 47 Files Affected:
diff --git a/libc/cmake/modules/LLVMLibCTestRules.cmake b/libc/cmake/modules/LLVMLibCTestRules.cmake
index 03b76508fdf6c..03b4b251649e7 100644
--- a/libc/cmake/modules/LLVMLibCTestRules.cmake
+++ b/libc/cmake/modules/LLVMLibCTestRules.cmake
@@ -36,7 +36,8 @@ function(_get_common_test_compile_options output_var c_test flags)
if(NOT LIBC_WNO_ERROR)
# list(APPEND compile_options "-Werror")
endif()
- list(APPEND compile_options "-Wconversion")
+ # list(APPEND compile_options "-Wconversion")
+ # list(APPEND compile_options "-Wno-sign-conversion")
list(APPEND compile_options "-Wimplicit-fallthrough")
list(APPEND compile_options "-Wwrite-strings")
# Silence this warning because _Complex is a part of C99.
diff --git a/libc/src/__support/CPP/bit.h b/libc/src/__support/CPP/bit.h
index 7d138201783bf..82b9eb5128262 100644
--- a/libc/src/__support/CPP/bit.h
+++ b/libc/src/__support/CPP/bit.h
@@ -101,7 +101,7 @@ countr_zero(T value) {
shift >>= 1;
mask >>= shift;
}
- return static_cast<int>(zero_bits);
+ return zero_bits;
}
#if __has_builtin(__builtin_ctzs)
ADD_SPECIALIZATION(countr_zero, unsigned short, __builtin_ctzs)
@@ -140,7 +140,7 @@ countl_zero(T value) {
else
zero_bits |= shift;
}
- return static_cast<int>(zero_bits);
+ return zero_bits;
}
#if __has_builtin(__builtin_clzs)
ADD_SPECIALIZATION(countl_zero, unsigned short, __builtin_clzs)
@@ -226,7 +226,7 @@ rotr(T value, int rotate);
template <typename T>
[[nodiscard]] LIBC_INLINE constexpr cpp::enable_if_t<cpp::is_unsigned_v<T>, T>
rotl(T value, int rotate) {
- constexpr int N = cpp::numeric_limits<T>::digits;
+ constexpr unsigned N = cpp::numeric_limits<T>::digits;
rotate = rotate % N;
if (!rotate)
return value;
@@ -238,7 +238,7 @@ rotl(T value, int rotate) {
template <typename T>
[[nodiscard]] LIBC_INLINE constexpr cpp::enable_if_t<cpp::is_unsigned_v<T>, T>
rotr(T value, int rotate) {
- constexpr int N = cpp::numeric_limits<T>::digits;
+ constexpr unsigned N = cpp::numeric_limits<T>::digits;
rotate = rotate % N;
if (!rotate)
return value;
diff --git a/libc/src/__support/CPP/span.h b/libc/src/__support/CPP/span.h
index 9234a26d201cd..a41c9b744e370 100644
--- a/libc/src/__support/CPP/span.h
+++ b/libc/src/__support/CPP/span.h
@@ -11,7 +11,6 @@
#include <stddef.h> // For size_t
#include "array.h" // For array
-#include "limits.h"
#include "src/__support/macros/config.h"
#include "type_traits.h" // For remove_cv_t, enable_if_t, is_same_v, is_const_v
@@ -49,8 +48,7 @@ template <typename T> class span {
using const_reference = const T &;
using iterator = T *;
- LIBC_INLINE_VAR static constexpr size_type dynamic_extent =
- cpp::numeric_limits<size_type>::max();
+ LIBC_INLINE_VAR static constexpr size_type dynamic_extent = -1;
LIBC_INLINE constexpr span() : span_data(nullptr), span_size(0) {}
@@ -60,7 +58,7 @@ template <typename T> class span {
: span_data(first), span_size(count) {}
LIBC_INLINE constexpr span(pointer first, pointer end)
- : span_data(first), span_size(static_cast<size_t>(end - first)) {}
+ : span_data(first), span_size(end - first) {}
template <typename U, size_t N,
cpp::enable_if_t<is_compatible_v<U>, bool> = true>
diff --git a/libc/src/__support/CPP/string.h b/libc/src/__support/CPP/string.h
index 1ac04c7f1f9dc..dbc0ae04e5e6f 100644
--- a/libc/src/__support/CPP/string.h
+++ b/libc/src/__support/CPP/string.h
@@ -67,8 +67,7 @@ class string {
: string(cstr, ::LIBC_NAMESPACE::internal::string_length(cstr)) {}
LIBC_INLINE string(size_t size_, char value) {
resize(size_);
- static_assert(sizeof(char) == sizeof(uint8_t));
- inline_memset((void *)buffer_, static_cast<uint8_t>(value), size_);
+ inline_memset((void *)buffer_, value, size_);
}
LIBC_INLINE string &operator=(const string &other) {
diff --git a/libc/src/__support/CPP/string_view.h b/libc/src/__support/CPP/string_view.h
index aa15814b2e149..745c62c35f0a0 100644
--- a/libc/src/__support/CPP/string_view.h
+++ b/libc/src/__support/CPP/string_view.h
@@ -9,7 +9,6 @@
#ifndef LLVM_LIBC_SRC___SUPPORT_CPP_STRING_VIEW_H
#define LLVM_LIBC_SRC___SUPPORT_CPP_STRING_VIEW_H
-#include "limits.h"
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
@@ -41,7 +40,7 @@ class string_view {
LIBC_INLINE static constexpr size_t length(const char *Str) {
for (const char *End = Str;; ++End)
if (*End == '\0')
- return static_cast<size_t>(End - Str);
+ return End - Str;
}
LIBC_INLINE bool equals(string_view Other) const {
@@ -62,8 +61,7 @@ class string_view {
// special value equal to the maximum value representable by the type
// size_type.
- LIBC_INLINE_VAR static constexpr size_t npos =
- cpp::numeric_limits<size_t>::max();
+ LIBC_INLINE_VAR static constexpr size_t npos = -1;
LIBC_INLINE constexpr string_view() : Data(nullptr), Len(0) {}
diff --git a/libc/src/__support/FPUtil/FPBits.h b/libc/src/__support/FPUtil/FPBits.h
index bee8d0a8dc47d..90b6e406e0f31 100644
--- a/libc/src/__support/FPUtil/FPBits.h
+++ b/libc/src/__support/FPUtil/FPBits.h
@@ -247,11 +247,11 @@ template <FPType fp_type> struct FPStorage : public FPLayout<fp_type> {
using UP::UP;
LIBC_INLINE constexpr BiasedExponent(Exponent exp)
- : UP(static_cast<uint32_t>(static_cast<int32_t>(exp) + EXP_BIAS)) {}
+ : UP(static_cast<int32_t>(exp) + EXP_BIAS) {}
// Cast operator to get convert from BiasedExponent to Exponent.
LIBC_INLINE constexpr operator Exponent() const {
- return Exponent(static_cast<int32_t>(UP::value - EXP_BIAS));
+ return Exponent(UP::value - EXP_BIAS);
}
LIBC_INLINE constexpr BiasedExponent &operator++() {
@@ -686,7 +686,7 @@ struct FPRepImpl : public FPRepSem<fp_type, RetT> {
}
LIBC_INLINE constexpr void set_biased_exponent(StorageType biased) {
- UP::set_biased_exponent(BiasedExponent(static_cast<uint32_t>(biased)));
+ UP::set_biased_exponent(BiasedExponent((int32_t)biased));
}
LIBC_INLINE constexpr int get_exponent() const {
diff --git a/libc/src/__support/FPUtil/NormalFloat.h b/libc/src/__support/FPUtil/NormalFloat.h
index a2f285fc6fb95..b4cbb5042a68b 100644
--- a/libc/src/__support/FPUtil/NormalFloat.h
+++ b/libc/src/__support/FPUtil/NormalFloat.h
@@ -105,7 +105,7 @@ template <typename T> struct NormalFloat {
constexpr int SUBNORMAL_EXPONENT = -FPBits<T>::EXP_BIAS + 1;
if (exponent < SUBNORMAL_EXPONENT) {
- unsigned shift = static_cast<unsigned>(SUBNORMAL_EXPONENT - exponent);
+ unsigned shift = SUBNORMAL_EXPONENT - exponent;
// Since exponent > subnormalExponent, shift is strictly greater than
// zero.
if (shift <= FPBits<T>::FRACTION_LEN + 1) {
@@ -160,7 +160,7 @@ template <typename T> struct NormalFloat {
if (bits.is_subnormal()) {
unsigned shift = evaluate_normalization_shift(bits.get_mantissa());
mantissa = static_cast<StorageType>(bits.get_mantissa() << shift);
- exponent = 1 - FPBits<T>::EXP_BIAS - static_cast<int32_t>(shift);
+ exponent = 1 - FPBits<T>::EXP_BIAS - shift;
} else {
exponent = bits.get_biased_exponent() - FPBits<T>::EXP_BIAS;
mantissa = ONE | bits.get_mantissa();
diff --git a/libc/src/__support/FPUtil/aarch64/FEnvImpl.h b/libc/src/__support/FPUtil/aarch64/FEnvImpl.h
index 914155a01631d..18b0631324f8f 100644
--- a/libc/src/__support/FPUtil/aarch64/FEnvImpl.h
+++ b/libc/src/__support/FPUtil/aarch64/FEnvImpl.h
@@ -110,7 +110,7 @@ LIBC_INLINE int enable_except(int excepts) {
(controlWord >> FEnv::ExceptionControlFlagsBitPosition) & 0x1F;
controlWord |= (newExcepts << FEnv::ExceptionControlFlagsBitPosition);
FEnv::writeControlWord(controlWord);
- return FEnv::exceptionStatusToMacro(static_cast<uint32_t>(oldExcepts));
+ return FEnv::exceptionStatusToMacro(oldExcepts);
}
LIBC_INLINE int disable_except(int excepts) {
@@ -120,12 +120,12 @@ LIBC_INLINE int disable_except(int excepts) {
(controlWord >> FEnv::ExceptionControlFlagsBitPosition) & 0x1F;
controlWord &= ~(disabledExcepts << FEnv::ExceptionControlFlagsBitPosition);
FEnv::writeControlWord(controlWord);
- return FEnv::exceptionStatusToMacro(static_cast<uint32_t>(oldExcepts));
+ return FEnv::exceptionStatusToMacro(oldExcepts);
}
LIBC_INLINE int get_except() {
uint32_t controlWord = FEnv::getControlWord();
- uint32_t enabledExcepts =
+ int enabledExcepts =
(controlWord >> FEnv::ExceptionControlFlagsBitPosition) & 0x1F;
return FEnv::exceptionStatusToMacro(enabledExcepts);
}
@@ -250,10 +250,8 @@ LIBC_INLINE int set_round(int mode) {
}
uint32_t controlWord = FEnv::getControlWord();
- controlWord &=
- static_cast<uint32_t>(~(0x3 << FEnv::RoundingControlBitPosition));
- controlWord |=
- static_cast<uint32_t>(bitValue << FEnv::RoundingControlBitPosition);
+ controlWord &= ~(0x3 << FEnv::RoundingControlBitPosition);
+ controlWord |= (bitValue << FEnv::RoundingControlBitPosition);
FEnv::writeControlWord(controlWord);
return 0;
diff --git a/libc/src/__support/FPUtil/aarch64/fenv_darwin_impl.h b/libc/src/__support/FPUtil/aarch64/fenv_darwin_impl.h
index dcce76b6116be..969e70796d1f1 100644
--- a/libc/src/__support/FPUtil/aarch64/fenv_darwin_impl.h
+++ b/libc/src/__support/FPUtil/aarch64/fenv_darwin_impl.h
@@ -63,7 +63,7 @@ struct FEnv {
// __fpcr_flush_to_zero bit in the FPCR register. This control bit is
// located in a different place from FE_FLUSHTOZERO status bit relative to
// the other exceptions.
- LIBC_INLINE static uint32_t exception_value_from_status(uint32_t status) {
+ LIBC_INLINE static uint32_t exception_value_from_status(int status) {
return ((status & FE_INVALID) ? EX_INVALID : 0) |
((status & FE_DIVBYZERO) ? EX_DIVBYZERO : 0) |
((status & FE_OVERFLOW) ? EX_OVERFLOW : 0) |
@@ -72,7 +72,7 @@ struct FEnv {
((status & FE_FLUSHTOZERO) ? EX_FLUSHTOZERO : 0);
}
- LIBC_INLINE static uint32_t exception_value_from_control(uint32_t control) {
+ LIBC_INLINE static uint32_t exception_value_from_control(int control) {
return ((control & __fpcr_trap_invalid) ? EX_INVALID : 0) |
((control & __fpcr_trap_divbyzero) ? EX_DIVBYZERO : 0) |
((control & __fpcr_trap_overflow) ? EX_OVERFLOW : 0) |
@@ -81,7 +81,7 @@ struct FEnv {
((control & __fpcr_flush_to_zero) ? EX_FLUSHTOZERO : 0);
}
- LIBC_INLINE static uint32_t exception_value_to_status(uint32_t excepts) {
+ LIBC_INLINE static int exception_value_to_status(uint32_t excepts) {
return ((excepts & EX_INVALID) ? FE_INVALID : 0) |
((excepts & EX_DIVBYZERO) ? FE_DIVBYZERO : 0) |
((excepts & EX_OVERFLOW) ? FE_OVERFLOW : 0) |
@@ -90,7 +90,7 @@ struct FEnv {
((excepts & EX_FLUSHTOZERO) ? FE_FLUSHTOZERO : 0);
}
- LIBC_INLINE static uint32_t exception_value_to_control(uint32_t excepts) {
+ LIBC_INLINE static int exception_value_to_control(uint32_t excepts) {
return ((excepts & EX_INVALID) ? __fpcr_trap_invalid : 0) |
((excepts & EX_DIVBYZERO) ? __fpcr_trap_divbyzero : 0) |
((excepts & EX_OVERFLOW) ? __fpcr_trap_overflow : 0) |
@@ -113,37 +113,34 @@ struct FEnv {
};
LIBC_INLINE int enable_except(int excepts) {
- uint32_t new_excepts =
- FEnv::exception_value_from_status(static_cast<uint32_t>(excepts));
+ uint32_t new_excepts = FEnv::exception_value_from_status(excepts);
uint32_t control_word = FEnv::get_control_word();
uint32_t old_excepts = FEnv::exception_value_from_control(control_word);
if (new_excepts != old_excepts) {
control_word |= FEnv::exception_value_to_control(new_excepts);
FEnv::set_control_word(control_word);
}
- return static_cast<int>(FEnv::exception_value_to_status(old_excepts));
+ return FEnv::exception_value_to_status(old_excepts);
}
LIBC_INLINE int disable_except(int excepts) {
- uint32_t disabled_excepts =
- FEnv::exception_value_from_status(static_cast<uint32_t>(excepts));
+ uint32_t disabled_excepts = FEnv::exception_value_from_status(excepts);
uint32_t control_word = FEnv::get_control_word();
uint32_t old_excepts = FEnv::exception_value_from_control(control_word);
control_word &= ~FEnv::exception_value_to_control(disabled_excepts);
FEnv::set_control_word(control_word);
- return static_cast<int>(FEnv::exception_value_to_status(old_excepts));
+ return FEnv::exception_value_to_status(old_excepts);
}
LIBC_INLINE int get_except() {
uint32_t control_word = FEnv::get_control_word();
uint32_t enabled_excepts = FEnv::exception_value_from_control(control_word);
- return static_cast<int>(FEnv::exception_value_to_status(enabled_excepts));
+ return FEnv::exception_value_to_status(enabled_excepts);
}
LIBC_INLINE int clear_except(int excepts) {
uint32_t status_word = FEnv::get_status_word();
- uint32_t except_value =
- FEnv::exception_value_from_status(static_cast<uint32_t>(excepts));
+ uint32_t except_value = FEnv::exception_value_from_status(excepts);
status_word &= ~FEnv::exception_value_to_status(except_value);
FEnv::set_status_word(status_word);
return 0;
@@ -151,16 +148,13 @@ LIBC_INLINE int clear_except(int excepts) {
LIBC_INLINE int test_except(int excepts) {
uint32_t statusWord = FEnv::get_status_word();
- uint32_t ex_value =
- FEnv::exception_value_from_status(static_cast<uint32_t>(excepts));
- return static_cast<int>(statusWord &
- FEnv::exception_value_to_status(ex_value));
+ uint32_t ex_value = FEnv::exception_value_from_status(excepts);
+ return statusWord & FEnv::exception_value_to_status(ex_value);
}
LIBC_INLINE int set_except(int excepts) {
uint32_t status_word = FEnv::get_status_word();
- uint32_t new_exceptions =
- FEnv::exception_value_from_status(static_cast<uint32_t>(excepts));
+ uint32_t new_exceptions = FEnv::exception_value_from_status(excepts);
status_word |= FEnv::exception_value_to_status(new_exceptions);
FEnv::set_status_word(status_word);
return 0;
@@ -180,8 +174,7 @@ LIBC_INLINE int raise_except(int excepts) {
: "s0", "s1" /* s0 and s1 are clobbered */);
};
- uint32_t to_raise =
- FEnv::exception_value_from_status(static_cast<uint32_t>(excepts));
+ uint32_t to_raise = FEnv::exception_value_from_status(excepts);
int result = 0;
if (to_raise & FEnv::EX_INVALID) {
@@ -244,7 +237,7 @@ LIBC_INLINE int get_round() {
}
LIBC_INLINE int set_round(int mode) {
- uint32_t bit_value;
+ uint16_t bit_value;
switch (mode) {
case FE_TONEAREST:
bit_value = FEnv::TONEAREST;
@@ -263,7 +256,7 @@ LIBC_INLINE int set_round(int mode) {
}
uint32_t control_word = FEnv::get_control_word();
- control_word &= ~(0x3u << FEnv::ROUNDING_CONTROL_BIT_POSITION);
+ control_word &= ~(0x3 << FEnv::ROUNDING_CONTROL_BIT_POSITION);
control_word |= (bit_value << FEnv::ROUNDING_CONTROL_BIT_POSITION);
FEnv::set_control_word(control_word);
diff --git a/libc/src/__support/FPUtil/generic/sqrt_80_bit_long_double.h b/libc/src/__support/FPUtil/generic/sqrt_80_bit_long_double.h
index 0ba836d17a085..9492d52da0455 100644
--- a/libc/src/__support/FPUtil/generic/sqrt_80_bit_long_double.h
+++ b/libc/src/__support/FPUtil/generic/sqrt_80_bit_long_double.h
@@ -24,7 +24,7 @@ namespace x86 {
LIBC_INLINE void normalize(int &exponent,
FPBits<long double>::StorageType &mantissa) {
const unsigned int shift = static_cast<unsigned int>(
- static_cast<size_t>(cpp::countl_zero(static_cast<uint64_t>(mantissa))) -
+ cpp::countl_zero(static_cast<uint64_t>(mantissa)) -
(8 * sizeof(uint64_t) - 1 - FPBits<long double>::FRACTION_LEN));
exponent -= shift;
mantissa <<= shift;
diff --git a/libc/src/__support/OSUtil/darwin/io.h b/libc/src/__support/OSUtil/darwin/io.h
index 69df99da522fb..a5f7ecbd70362 100644
--- a/libc/src/__support/OSUtil/darwin/io.h
+++ b/libc/src/__support/OSUtil/darwin/io.h
@@ -17,8 +17,7 @@ namespace LIBC_NAMESPACE_DECL {
LIBC_INLINE void write_to_stderr(cpp::string_view msg) {
LIBC_NAMESPACE::syscall_impl(4 /*SYS_write*/, 2 /* stderr */,
- reinterpret_cast<long>(msg.data()),
- static_cast<long>(msg.size()));
+ reinterpret_cast<long>(msg.data()), msg.size());
}
} // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/src/__support/big_int.h b/libc/src/__support/big_int.h
index f44624a7eafce..e726a094b5dac 100644
--- a/libc/src/__support/big_int.h
+++ b/libc/src/__support/big_int.h
@@ -284,7 +284,7 @@ LIBC_INLINE constexpr cpp::array<word, N> shift(cpp::array<word, N> array,
if (i < 0)
return 0;
if (i >= int(N))
- return is_neg ? cpp::numeric_limits<word>::max() : 0;
+ return is_neg ? -1 : 0;
return array[i];
};
const size_t index_offset = offset / WORD_BITS;
@@ -696,8 +696,7 @@ struct BigInt {
}
BigInt quotient;
WordType x_word = static_cast<WordType>(x);
- constexpr size_t LOG2_WORD_SIZE =
- static_cast<size_t>(cpp::bit_width(WORD_SIZE) - 1);
+ constexpr size_t LOG2_WORD_SIZE = cpp::bit_width(WORD_SIZE) - 1;
constexpr size_t HALF_WORD_SIZE = WORD_SIZE >> 1;
constexpr WordType HALF_MASK = ((WordType(1) << HALF_WORD_SIZE) - 1);
// lower = smallest multiple of WORD_SIZE that is >= e.
@@ -1009,12 +1008,12 @@ struct BigInt {
BigInt subtractor = divider;
int cur_bit = multiword::countl_zero(subtractor.val) -
multiword::countl_zero(remainder.val);
- subtractor <<= static_cast<size_t>(cur_bit);
+ subtractor <<= cur_bit;
for (; cur_bit >= 0 && remainder > 0; --cur_bit, subtractor >>= 1) {
if (remainder < subtractor)
continue;
remainder -= subtractor;
- quotient.set_bit(static_cast<size_t>(cur_bit));
+ quotient.set_bit(cur_bit);
}
}
return Division{quotient, remainder};
@@ -1276,28 +1275,26 @@ rotr(T value, int rotate);
template <typename T>
[[nodiscard]] LIBC_INLINE constexpr cpp::enable_if_t<is_big_int_v<T>, T>
rotl(T value, int rotate) {
- constexpr int N = cpp::numeric_limits<T>::digits;
+ constexpr unsigned N = cpp::numeric_limits<T>::digits;
rotate = rotate % N;
if (!rotate)
return value;
if (rotate < 0)
return cpp::rotr<T>(value, -rotate);
- return (value << static_cast<size_t>(rotate)) |
- (value >> (N - static_cast<size_t>(rotate)));
+ return (value << rotate) | (value >> (N - rotate));
}
// Specialization of cpp::rotr ('bit.h') for BigInt.
template <typename T>
[[nodiscard]] LIBC_INLINE constexpr cpp::enable_if_t<is_big_int_v<T>, T>
rotr(T value, int rotate) {
- constexpr int N = cpp::numeric_limits<T>::digits;
+ constexpr unsigned N = cpp::numeric_limits<T>::digits;
rotate = rotate % N;
if (!rotate)
return value;
if (rotate < 0)
return cpp::rotl<T>(value, -rotate);
- return (value >> static_cast<size_t>(rotate)) |
- (value << (N - static_cast<size_t>(rotate)));
+ return (value >> rotate) | (value << (N - rotate));
}
} // namespace cpp
@@ -1314,7 +1311,7 @@ mask_trailing_ones() {
T out; // zero initialized
for (size_t i = 0; i <= QUOTIENT; ++i)
out[i] = i < QUOTIENT
- ? cpp::numeric_limits<typename T::word_type>::max()
+ ? -1
: mask_trailing_ones<typename T::word_type, REMAINDER>();
return out;
}
@@ -1330,7 +1327,7 @@ LIBC_INLINE constexpr cpp::enable_if_t<is_big_int_v<T>, T> mask_leading_ones() {
T out; // zero initialized
for (size_t i = QUOTIENT; i < T::WORD_COUNT; ++i)
out[i] = i > QUOTIENT
- ? cpp::numeric_limits<typename T::word_type>::max()
+ ? -1
: mask_leading_ones<typename T::word_type, REMAINDER>();
return out;
}
diff --git a/libc/src/__support/high_precision_decimal.h b/libc/src/__support/high_precision_decimal.h
index cb4b50c315447..922dce484aa6b 100644
--- a/libc/src/__support/high_precision_decimal.h
+++ b/libc/src/__support/high_precision_decimal.h
@@ -264,7 +264,7 @@ class HighPrecisionDecimal {
LIBC_INLINE void left_shift(uint32_t shift_amount) {
uint32_t new_digits = this->get_num_new_digits(shift_amount);
- ...
[truncated]
|
This reverts commit 1e6e845 because it changed the 1st parameter of adjust() to be unsigned, but libc itself calls adjust() with a negative argument in align_backward() in op_generic.h.
3f4e884
to
da61b0d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
This reverts commit 1e6e845 because it changed the 1st parameter of adjust() to be unsigned, but libc itself calls adjust() with a negative argument in align_backward() in op_generic.h.