(j3.2006) EXTERNAL statement in an INTERFACE body

Daniel C Chen cdchen
Wed Apr 13 14:53:33 EDT 2016



Hello all,

Is the following code valid?

program main
  real ext, inval
  interface
    function ext1 (y)
      real ext1, y
      external ext1
    end function ext1  ! Duplicate EXTERNAL attribute
  end interface
  inval = 1.0
  print *, ext1(inval)
end program main

The EXTERNAL statement is allowed inside an interface body. However, we
have a constraint as:

[16-007: p118] C542 In an external subprogram, the EXTERNAL attribute shall
not be specified for a procedure defined by the subprogram.

It only mentions 'external subprogram'. Should it also include interface
body to be consistent?

Thanks,

Daniel

XL Fortran Development - IBM Toronto Software Lab
Phone: 905-413-3056
Tie: 969-3056
Email: cdchen at ca.ibm.com
http://www.ibm.com/software/awdtools/fortran/xlfortran
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.j3-fortran.org/pipermail/j3/attachments/20160413/cacb4536/attachment.html 



More information about the J3 mailing list