Yo Greg!
On Sat, 31 Oct 2026 08:11:27 -0400
Greg Troxel <[email protected]> wrote:
> I thought we had fixed all of these, but I'm building/testing git
> master (to verify that WRITE_PAD is still needed), and see the
> following warnings in the build. This is the signature of invoking
> a ctype(3) function with type char, which could be signed, and if
> negative, would be promoted to a negative int, which gets you into
> UB, per ISO C -- the only allowable values are those representable as
> unsigned char and EOF.
The POSIX 2024 man page is here:
https://pubs.opengroup.org/onlinepubs/9799919799/functions/iscntrl_l.html
int iscntrl(int c);
Been that way since POSIX.1-2008.
From C99:
7.4.1.4 The iscntrl function
Synopsis
#include <ctype.h>
int iscntrl(int c);
gpsd requires C99 and POSIX 2008. So the current code is correct.
On Oct 31, 2026 12:40, "Gary E. Miller" <[email protected]> wrote:
My rat brain is screaming at me that it has come up before that someone had gpsd trouble on a platform with unsigned chars. I am too lazy to look up the reference right now.
Ah, I think it was ESR and Fred Wright talking about IBM mainframe stuff that I misremember. 370?
- more ctype(3) UB has crept in Greg Troxel
- Re: more ctype(3) UB has crept in Gary E. Miller
- Re: more ctype(3) UB has crept in Gary E. Miller
- Re: more ctype(3) UB has crept in James Browning
- Re: more ctype(3) UB has crept in Greg Troxel
- Re: more ctype(3) UB has crept in Greg Troxel
- Re: more ctype(3) UB has crept in Gary E. Miller
- Re: more ctype(3) UB has crept in Greg Troxel
- Re: more ctype(3) UB has crept in Gary E. Miller
- Re: more ctype(3) UB has crept in Greg Troxel
- Re: more ctype(3) UB has crept in Greg Troxel
- Re: more ctype(3) UB has crept in Gary E. Miller
- Re: more ctype(3) UB has crep... Greg Troxel
- Re: more ctype(3) UB has crep... Gary E. Miller
