This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Bug 86694 - gfortran rejects character parameter binding label
- From: Damian Rouson <damian at sourceryinstitute dot org>
- To: gfortran <fortran at gcc dot gnu dot org>
- Cc: "Filippone, Salvatore" <salvatore dot filippone at cranfield dot ac dot uk>
- Date: Fri, 27 Jul 2018 09:33:25 +0100
- Subject: Bug 86694 - gfortran rejects character parameter binding label
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