libstdc++: Fix <charconv> uses of signed types with <bit> functions
In <charconv> we pass the int __base parameter to our internal versions of <bit> functions, __bit_width and __countr_zero. Those functions are only defined for unsigned types, so we need to convert the base to unsigned. The base must be in the range [2,36] so we can mask off the low bits and then convert that to unsigned, so that we don't need to care about negative values becoming large unsigned values. libstdc++-v3/ChangeLog: * include/std/charconv (__from_chars_pow2_base): Convert base to unsigned for call to __countr_zero. (__from_chars_alnum): Likewise for call to __bit_width.
Loading
Please register or sign in to comment