Bug 86694 - gfortran rejects character parameter binding label
Damian Rouson
damian@sourceryinstitute.org
Fri Jul 27 08:33:00 GMT 2018
The consensus opinion on the J3 mailing list is that the code below is
standard-conforming. The Intel compiler accepts the code. gfortran
5.5, 6.4, 7.3, and 8.2 generate the error message below.
Damian
$ cat c-name.f90
character(len=5), parameter :: c_name="c_foo"
interface
subroutine foo() bind(C,name=c_name)
import c_name
end subroutine
end interface
end
$ gfortran -c c-name.f90
c-name.f90:3:31:
subroutine foo() bind(C,name=c_name)
1
Error: Parameter ‘c_name’ at (1) has not been declared or is a
variable, which does not reduce to a constant expression
c-name.f90:4:10:
import c_name
1
Error: IMPORT statement at (1) only permitted in an INTERFACE body
c-name.f90:5:5:
end subroutine
1
Error: Expecting END INTERFACE statement at (1)
$ gfortran --version
GNU Fortran (GCC) 8.2.0
More information about the Fortran
mailing list