RFR: 8332400: isspace argument should be a valid unsigned char
David Holmes
dholmes at openjdk.org
Mon Jun 10 08:23:13 UTC 2024
On Fri, 7 Jun 2024 06:07:17 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:
> "To use these functions safely with plain chars (or signed chars), the argument should first be converted to unsigned char"
@tstuefe wow! Okay. That is a surprise to me. A cast to unsigned char doesn't actually do anything. Every char is "representable" as an unsigned char because it holds a bit pattern between 0x00 and 0xff i.e. the function is well defined if the incoming int is either EOF (int -1) or else in the range 0x00 to 0xff. But I did a bit of searching and it seems it comes down to potential arithmetic operations on the "char" the might behave differently depending on the signed-ness. :(
-------------
PR Comment: https://git.openjdk.org/jdk/pull/19567#issuecomment-2157677944
More information about the core-libs-dev
mailing list