https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101317
Bug ID: 101317 Summary: Bind(C): improve error checking in CFI_* functions declared in ISO_Fortran_binding.h Product: gcc Version: 12.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libfortran Assignee: unassigned at gcc dot gnu.org Reporter: sandra at gcc dot gnu.org Target Milestone: --- ISO_Fortran_binding.h defines macros to indicate error conditions in functions such as CFI_establish, CFI_setpointer, etc that are declared in that header; it's table 18.5 in the 2018 Fortran standard. There seems to be no actual requirement that the library functions detect and return particular error codes (IIUC the "shall be" language in the argument descriptions implies undefined behavior otherwise), but the functions already do detect some errors with -fcheck=all. However, I noted some other easy-to-detect errors are not being checked. Test cases are library/establish-errors.f90 and library/setpointer-errors.f90, in the WIP TS 29113 testsuite. https://gcc.gnu.org/pipermail/gcc-patches/2021-July/574115.html