Re: RFR: 8332400: isspace argument should be a valid unsigned char [v2]

2024-06-12 Thread Julian Waters
On Tue, 11 Jun 2024 18:07:10 GMT, Robert Toyonaga wrote: >> ### Summary >> This change ensures we don't get undefined behavior when >> calling[`isspace`](https://pubs.opengroup.org/onlinepubs/007904975/functions/isspace.html). >> `isspace` accepts an `int` argument that "the application shall

Re: RFR: 8332400: isspace argument should be a valid unsigned char [v2]

2024-06-12 Thread Thomas Stuefe
On Tue, 11 Jun 2024 18:07:10 GMT, Robert Toyonaga wrote: >> ### Summary >> This change ensures we don't get undefined behavior when >> calling[`isspace`](https://pubs.opengroup.org/onlinepubs/007904975/functions/isspace.html). >> `isspace` accepts an `int` argument that "the application shall

Re: RFR: 8332400: isspace argument should be a valid unsigned char [v2]

2024-06-12 Thread Amit Kumar
On Tue, 11 Jun 2024 18:07:10 GMT, Robert Toyonaga wrote: >> ### Summary >> This change ensures we don't get undefined behavior when >> calling[`isspace`](https://pubs.opengroup.org/onlinepubs/007904975/functions/isspace.html). >> `isspace` accepts an `int` argument that "the application shall

Re: RFR: 8332400: isspace argument should be a valid unsigned char [v2]

2024-06-11 Thread David Holmes
On Tue, 11 Jun 2024 18:07:10 GMT, Robert Toyonaga wrote: >> ### Summary >> This change ensures we don't get undefined behavior when >> calling[`isspace`](https://pubs.opengroup.org/onlinepubs/007904975/functions/isspace.html). >> `isspace` accepts an `int` argument that "the application shall

Re: RFR: 8332400: isspace argument should be a valid unsigned char

2024-06-11 Thread Robert Toyonaga
On Wed, 5 Jun 2024 20:08:10 GMT, Robert Toyonaga wrote: > ### Summary > This change ensures we don't get undefined behavior when > calling[`isspace`](https://pubs.opengroup.org/onlinepubs/007904975/functions/isspace.html). > `isspace` accepts an `int` argument that "the application shall ensur

Re: RFR: 8332400: isspace argument should be a valid unsigned char [v2]

2024-06-11 Thread Robert Toyonaga
> ### Summary > This change ensures we don't get undefined behavior when > calling[`isspace`](https://pubs.opengroup.org/onlinepubs/007904975/functions/isspace.html). > `isspace` accepts an `int` argument that "the application shall ensure is a > character representable as an unsigned char or e

Re: RFR: 8332400: isspace argument should be a valid unsigned char

2024-06-10 Thread David Holmes
On Mon, 10 Jun 2024 13:36:06 GMT, Robert Toyonaga wrote: > But what about when an int is passed to isspace? The current casts to int are incorrect as a negative value would be sign-extended and then fail the range check. I think we have to cast to unsigned char in all cases in the caller, whic

Re: RFR: 8332400: isspace argument should be a valid unsigned char

2024-06-10 Thread Robert Toyonaga
On Wed, 5 Jun 2024 20:08:10 GMT, Robert Toyonaga wrote: > ### Summary > This change ensures we don't get undefined behavior when > calling[`isspace`](https://pubs.opengroup.org/onlinepubs/007904975/functions/isspace.html). > `isspace` accepts an `int` argument that "the application shall ensur

Re: RFR: 8332400: isspace argument should be a valid unsigned char

2024-06-10 Thread Johan Sjölen
On Wed, 5 Jun 2024 20:08:10 GMT, Robert Toyonaga wrote: > ### Summary > This change ensures we don't get undefined behavior when > calling[`isspace`](https://pubs.opengroup.org/onlinepubs/007904975/functions/isspace.html). > `isspace` accepts an `int` argument that "the application shall ensur

Re: RFR: 8332400: isspace argument should be a valid unsigned char

2024-06-10 Thread Thomas Stuefe
On Mon, 10 Jun 2024 08:20:38 GMT, David Holmes 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. Ev

Re: RFR: 8332400: isspace argument should be a valid unsigned char

2024-06-10 Thread David Holmes
On Fri, 7 Jun 2024 06:07:17 GMT, Thomas Stuefe 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 i

Re: RFR: 8332400: isspace argument should be a valid unsigned char

2024-06-06 Thread Thomas Stuefe
On Thu, 6 Jun 2024 21:21:23 GMT, David Holmes wrote: >> ### Summary >> This change ensures we don't get undefined behavior when >> calling[`isspace`](https://pubs.opengroup.org/onlinepubs/007904975/functions/isspace.html). >> `isspace` accepts an `int` argument that "the application shall ensu

Re: RFR: 8332400: isspace argument should be a valid unsigned char

2024-06-06 Thread David Holmes
On Wed, 5 Jun 2024 20:08:10 GMT, Robert Toyonaga wrote: > ### Summary > This change ensures we don't get undefined behavior when > calling[`isspace`](https://pubs.opengroup.org/onlinepubs/007904975/functions/isspace.html). > `isspace` accepts an `int` argument that "the application shall ensur

RFR: 8332400: isspace argument should be a valid unsigned char

2024-06-06 Thread Robert Toyonaga
### Summary This change ensures we don't get undefined behavior when calling[`isspace`](https://pubs.opengroup.org/onlinepubs/007904975/functions/isspace.html). `isspace` accepts an `int` argument that "the application shall ensure is a character representable as an unsigned char or equal to th