https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79330
--- Comment #5 from anlauf at gcc dot gnu.org --- (In reply to kargls from comment #4) > (In reply to Jerry DeLisle from comment #3) > > Still fails on trunk (16) > > In looking at the code, I'm wondering if it conforms to the Fortran standard. > > module caf_openmp_interface > implicit none > character(len=*), parameter :: PREFIX="_gfortran_" > > ! Clearly, prefix is declared outside of the interface. > > interface > > ! Interface is a new namespace and one normally needs to import > ! symbols from outside the interface. But, here, prefix is not > ! within the namespace of the subroutine (?) . > > module subroutine this_image() bind(C,name=PREFIX//"caf_this_image") > implicit none > end subroutine > end interface > end module > > > What to other compilers do with the code? NAG and Intel and Nvidia accept this version (using "module subroutine"). However, for an "ordinary" subroutine they give: NAG Fortran Compiler Release 7.2(Shin-Urayasu) Build 7200 Error: pr79330.f90, line 8: Implicit type for PREFIX in THIS_IMAGE detected at NONE@<end-of-statement> Warning: pr79330.f90, line 10: Symbol PREFIX referenced but never set and pr79330.f90(10): error #6054: A CHARACTER data type is required in this context. [PREFIX] end subroutine this_image ^ pr79330.f90(10): error #8066: The NAME= specifier in BIND statement or in the BIND attribute specification of a type declaration statement must be a character initialization expression. end subroutine this_image ^ pr79330.f90(7): error #6404: This name does not have a type, and must have an explicit type. [PREFIX] subroutine this_image() bind(C,name=PREFIX//"caf_this_image") -----------------------------------------^ and NVFORTRAN-S-0146-Expression must be character type (pr79330.f90: 7) NVFORTRAN-F-1250-The NAME= specifier in BIND statement or in the BIND attribute specification of a type declaration statement must be a character initialization expression - prefix. (pr79330.f90: 7) respectively.