Re: Possibly buggy use of ctype.h macros.

2024-01-02 Thread Takashi Yano via Cygwin
On Tue, 02 Jan 2024 19:59:57 -0800 Kaz Kylheku wrote: > On 2024-01-02 16:11, Takashi Yano via Cygwin wrote: > > Perhaps, the off-by-one is for EOF as you guess. > > I doubt it. If EOF were out of range of char, it would have to be -129 or > less, > so that -127 would look even more wrong. > > I

Re: Possibly buggy use of ctype.h macros.

2024-01-02 Thread Kaz Kylheku via Cygwin
On 2024-01-02 16:11, Takashi Yano via Cygwin wrote: > Perhaps, the off-by-one is for EOF as you guess. I doubt it. If EOF were out of range of char, it would have to be -129 or less, so that -127 would look even more wrong. I see EOF is just -1. That value will also be produced by '\xFF', or "\xf

Re: Possibly buggy use of ctype.h macros.

2024-01-02 Thread Takashi Yano via Cygwin
On Tue, 02 Jan 2024 15:56:00 -0800 Kaz Kylheku wrote: > On 2024-01-02 15:25, Takashi Yano via Cygwin wrote: > > On Tue, 02 Jan 2024 14:18:15 -0800 > > Kaz Kylheku via Cygwin wrote: > >> I noticed that this macro, defined in winsup/cygwin/local_includes/path.h: > >> > >> #define isdrive(s) (isa

Re: Possibly buggy use of ctype.h macros.

2024-01-02 Thread Kaz Kylheku via Cygwin
On 2024-01-02 15:25, Takashi Yano via Cygwin wrote: > On Tue, 02 Jan 2024 14:18:15 -0800 > Kaz Kylheku via Cygwin wrote: >> I noticed that this macro, defined in winsup/cygwin/local_includes/path.h: >> >> #define isdrive(s) (isalpha (*(s)) && (s)[1] == ':') >> >> is being used with arguments of

Re: Possibly buggy use of ctype.h macros.

2024-01-02 Thread Takashi Yano via Cygwin
On Tue, 02 Jan 2024 14:18:15 -0800 Kaz Kylheku via Cygwin wrote: > I noticed that this macro, defined in winsup/cygwin/local_includes/path.h: > > #define isdrive(s) (isalpha (*(s)) && (s)[1] == ':') > > is being used with arguments of type char, like dereferenced "char *" > pointers. > >

Possibly buggy use of ctype.h macros.

2024-01-02 Thread Kaz Kylheku via Cygwin
Hi All, I noticed that this macro, defined in winsup/cygwin/local_includes/path.h: #define isdrive(s) (isalpha (*(s)) && (s)[1] == ':') is being used with arguments of type char, like dereferenced "char *" pointers. Unless the isalpha implementation is robust against this, it should be i