[Bug fortran/66973] Incorrect resolution of generic interface with TYPE(C_PTR)

anlauf at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Apr 12 18:48:23 GMT 2023


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66973

anlauf at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|2015-07-22 00:00:00         |2023-4-12
                 CC|                            |anlauf at gcc dot gnu.org

--- Comment #7 from anlauf at gcc dot gnu.org ---
This issue still persists at r13-7146 when using separate files for the
module and the main program.

gfortran's behavior is fragile: using e.g.

  USE ISO_C_BINDING, only: C_PTR

in the module makes the code work as desired (needs USE ISO_C_BINDING in the
main).

However, using

  USE ISO_C_BINDING, only: C_PTR, C_LOC

in the module breaks it again.

The behavior also depends on the order of USE statements in the main:

  USE H5T
  USE ISO_C_BINDING

differs from

  USE ISO_C_BINDING
  USE H5T

which should not happen...


More information about the Gcc-bugs mailing list