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 Steve Kargl <kargl@gcc.gnu.org> 2021-05-22 13:27:42 +02:00
config Update copyright years. 2021-01-04 10:26:59 +01:00
generated PR libfortran/99218 - matmul on temporary array accesses invalid memory 2021-03-05 20:58:51 +01:00
ieee libgfortran: Fix PR95647 by changing the interfaces of operators .eq. and .ne. 2021-02-12 07:58:16 -08:00
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 PR libfortran/99218 - matmul on temporary array accesses invalid memory 2021-03-05 20:58:51 +01:00
runtime Fortran: Cast arguments of <ctype.h> functions to unsigned char 2021-12-18 09:21:16 +01:00
acinclude.m4
aclocal.m4 Add `--with-toolexeclibdir=' configuration option 2020-01-24 11:24:25 +00:00
c99_protos.h Update copyright years. 2021-01-04 10:26:59 +01:00
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 Update copyright years. 2019-01-01 13:31:55 +01:00
ChangeLog-2019 Update copyright years. 2020-01-01 12:51:42 +01:00
ChangeLog-2020 Rotate ChangeLog files - part 1 - add ChangeLog-2020. 2021-01-01 17:27:52 +01:00
config.h.in libgfortran: Provide some further math library fallbacks [PR94694] 2020-04-22 21:34:19 +02:00
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 aix: Add GCC64 configuration and FAT target libraries. 2020-06-21 14:14:46 -04:00
gfortran.map Steve Kargl <kargl@gcc.gnu.org> 2021-05-22 13:27:42 +02:00
ISO_Fortran_binding.h Fortran: Fix Bind(C) Array-Descriptor Conversion 2021-10-18 10:29:30 +02:00
kinds-override.h Update copyright years. 2021-01-04 10:26:59 +01:00
libgfortran.h Fortran: Cast arguments of <ctype.h> functions to unsigned char 2021-12-18 09:21:16 +01:00
libgfortran.spec.in libgfortran: Use the libtool macro to determine libm availability. 2021-08-27 16:50:19 +01:00
libtool-version
Makefile.am libgfortran: Makefile fix for ISO_Fortran_binding.h 2021-09-07 17:46:05 +02:00
Makefile.in libgfortran: Makefile fix for ISO_Fortran_binding.h 2021-09-07 17:46:05 +02:00
mk-kinds-h.sh Fortran: Revert to non-multilib-specific ISO_Fortran_binding.h 2021-09-06 21:28:50 -07:00
mk-sik-inc.sh libgfortran: Skip integer-kind=16 check for amdgcn 2020-07-26 07:20:24 +02:00
mk-srk-inc.sh libgfortran: Skip integer-kind=16 check for amdgcn 2020-07-26 07:20:24 +02:00