Hi FX,
Am 16.12.21 um 21:22 schrieb FX via Fortran:
Hi,
Functions from <ctype.h> should only be called on values that can be
represented by unsigned char. On targets where char is a signed type, some of
libgfortran calls have undefined behaviour.
The solution is to cast the argument to unsigned char type. I’ve defined macros
in libgfortran.h to do so, to retain legibility of the library code.
Bootstrapped and regtested on x86_64-pc-linux-gnu.
OK to commit?
FX
I think that is basically OK.
However, I am wondering if calling the macros safe_* gives a false
impression of what they actually do. The cases where they are used
with your patch applied seem sane, for now, though.
Thanks for the patch!
Harald