Re: [PATCH] libstdc++: Avoid ASCII assumptions in floating_from_chars.cc

2022-04-21 Thread Jonathan Wakely via Gcc-patches
On Thu, 21 Apr 2022 at 15:38, Patrick Palka via Libstdc++ wrote: > > In starts_with_ci and in __floating_from_chars_hex's inf/nan handling, > we were assuming that the letters are contiguous and that 'A' + 32 == 'a' > which is true for ASCII but not for other character encodings. This > patch

[PATCH] libstdc++: Avoid ASCII assumptions in floating_from_chars.cc

2022-04-21 Thread Patrick Palka via Gcc-patches
In starts_with_ci and in __floating_from_chars_hex's inf/nan handling, we were assuming that the letters are contiguous and that 'A' + 32 == 'a' which is true for ASCII but not for other character encodings. This patch fixes starts_with_ci by using a constexpr lookup table that maps uppercase