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

Attachment: pr95177.patch
Description: Binary data

Reply via email to