gcc/libgfortran
François-Xavier Coudert 21423a1dfa Fortran: Cast arguments of <ctype.h> functions to unsigned char
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.

PR libfortran/95177

libgfortran/ChangeLog

	* libgfortran.h: include ctype.h, provide safe macros.
	* io/format.c: use safe macros.
	* io/list_read.c: use safe macros.
	* io/read.c: use safe macros.
	* io/write.c: use safe macros.
	* runtime/environ.c: use safe macros.
2021-12-18 09:21:16 +01:00
..
caf
config
generated
ieee
intrinsics Fix timezone handling near year boundaries 2021-12-16 17:45:51 +01:00
io Fortran: Cast arguments of <ctype.h> functions to unsigned char 2021-12-18 09:21:16 +01:00
m4
runtime Fortran: Cast arguments of <ctype.h> functions to unsigned char 2021-12-18 09:21:16 +01:00
acinclude.m4
aclocal.m4
c99_protos.h
ChangeLog Daily bump. 2021-12-17 00:16:20 +00:00
ChangeLog-2002
ChangeLog-2003
ChangeLog-2004
ChangeLog-2005
ChangeLog-2006
ChangeLog-2007
ChangeLog-2008
ChangeLog-2009
ChangeLog-2010
ChangeLog-2011
ChangeLog-2012
ChangeLog-2013
ChangeLog-2014
ChangeLog-2015
ChangeLog-2016
ChangeLog-2017
ChangeLog-2018
ChangeLog-2019
ChangeLog-2020
config.h.in
configure Fortran: Improve -Wmissing-include-dirs warnings [PR55534] 2021-09-22 20:58:35 +02:00
configure.ac Fortran: Improve -Wmissing-include-dirs warnings [PR55534] 2021-09-22 20:58:35 +02:00
configure.host
gfortran.map
ISO_Fortran_binding.h Fortran: Fix Bind(C) Array-Descriptor Conversion 2021-10-18 10:29:30 +02:00
kinds-override.h
libgfortran.h Fortran: Cast arguments of <ctype.h> functions to unsigned char 2021-12-18 09:21:16 +01:00
libgfortran.spec.in
libtool-version
Makefile.am
Makefile.in
mk-kinds-h.sh
mk-sik-inc.sh
mk-srk-inc.sh