public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
* Bug 86694 - gfortran rejects character parameter binding label
@ 2018-07-27  8:33 Damian Rouson
  0 siblings, 0 replies; only message in thread
From: Damian Rouson @ 2018-07-27  8:33 UTC (permalink / raw)
  To: gfortran; +Cc: Filippone, Salvatore

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-07-27  8:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-27  8:33 Bug 86694 - gfortran rejects character parameter binding label Damian Rouson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).