[Swan-dev] <ctype.h>'s is*(int)

Andrew Cagney andrew.cagney at gmail.com
Fri Nov 27 19:14:17 UTC 2020


I replaced calls with a custom char_is*(char) - our code deals with
octet sized characters in memory not EOF and int from fgetc().
See hunkcheck.c for how it is tested.

While I don't particularly like this solution I also don't partially
like <ctype.h>:
- the current locale can affect behaviour (yes libreswan should be run
with the C locale)
- all the unsigned char casts needed to make things work "correctly" are a pain
there's a useful discussion in
https://man.netbsd.org/man.netbsd.org/ctype.3#CAVEATS

Andrew


More information about the Swan-dev mailing list