gcc/libgfortran/runtime
Sandra Loosemore e78480ad09 Bind(c): Improve error checking in CFI_* functions
This patch adds additional run-time checking for invalid arguments to
CFI_establish and CFI_setpointer.  It also changes existing messages
throughout the CFI_* functions to use PRIiPTR to format CFI_index_t
values instead of casting them to int and using %d (which may not work
on targets where int is a smaller type), simplifies wording of some
messages, and fixes issues with capitalization, typos, and the like.
Additionally some coding standards problems such as >80 character lines
are addressed.

2021-07-24  Sandra Loosemore  <sandra@codesourcery.com>

	PR libfortran/101317

libgfortran/
	* runtime/ISO_Fortran_binding.c: Include <inttypes.h>.
	(CFI_address): Tidy error messages and comments.
	(CFI_allocate): Likewise.
	(CFI_deallocate): Likewise.
	(CFI_establish): Likewise.  Add new checks for validity of
	elem_len when it's used, plus type argument and extents.
	(CFI_is_contiguous): Tidy error messages and comments.
	(CFI_section): Likewise.  Refactor some repetitive code to
	make it more understandable.
	(CFI_select_part): Likewise.
	(CFI_setpointer): Likewise.  Check that source is not an
	unallocated allocatable array or an assumed-size array.

gcc/testsuite/
	* gfortran.dg/ISO_Fortran_binding_17.f90: Fix typo in error
	message patterns.
2021-07-27 21:24:26 -07:00
..
ISO_Fortran_binding.c Bind(c): Improve error checking in CFI_* functions 2021-07-27 21:24:26 -07:00
backtrace.c Update copyright years. 2021-01-04 10:26:59 +01:00
bounds.c Update copyright years. 2021-01-04 10:26:59 +01:00
compile_options.c Update copyright years. 2021-01-04 10:26:59 +01:00
convert_char.c Update copyright years. 2021-01-04 10:26:59 +01:00
environ.c Update copyright years. 2021-01-04 10:26:59 +01:00
error.c Update copyright years. 2021-01-04 10:26:59 +01:00
fpu.c Update copyright years. 2021-01-04 10:26:59 +01:00
in_pack_generic.c Update copyright years. 2021-01-04 10:26:59 +01:00
in_unpack_generic.c Update copyright years. 2021-01-04 10:26:59 +01:00
main.c Update copyright years. 2021-01-04 10:26:59 +01:00
memory.c Update copyright years. 2021-01-04 10:26:59 +01:00
minimal.c Update copyright years. 2021-01-04 10:26:59 +01:00
pause.c Update copyright years. 2021-01-04 10:26:59 +01:00
select.c Update copyright years. 2021-01-04 10:26:59 +01:00
select_inc.c Update copyright years. 2021-01-04 10:26:59 +01:00
stop.c Update copyright years. 2021-01-04 10:26:59 +01:00
string.c libgfortran: Fix negation for largest integer [PR81986] 2021-03-03 08:07:16 +01:00