This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]