Note 12.15

  • Follow


Has this been fixed in more recent drafts than N1830.pdf?

C:\gfortran\clf\opengl3>type note12_15.f90
module m1
   implicit none
   ABSTRACT INTERFACE
      FUNCTION REAL_FUNC (X)
         REAL, INTENT (IN) :: X
         REAL :: REAL_FUNC
      END FUNCTION REAL_FUNC
   END INTERFACE
   INTERFACE
      SUBROUTINE SUB (X)
         REAL, INTENT (IN) :: X
      END SUBROUTINE SUB
   END INTERFACE
!-- Some external or dummy procedures with explicit interface.
   PROCEDURE (REAL_FUNC) :: BESSEL, GFUN
   PROCEDURE (SUB) :: PRINT_REAL
!-- Some procedure pointers with explicit interface,
!-- one initialized to NULL().
   PROCEDURE (REAL_FUNC), POINTER :: P, R => NULL()
   PROCEDURE (REAL_FUNC), POINTER :: PTR_TO_GFUN
!-- A derived type with a procedure pointer component ...
   TYPE STRUCT_TYPE
      PROCEDURE (REAL_FUNC), POINTER :: COMPONENT
! Should be:
!      PROCEDURE (REAL_FUNC), POINTER, NOPASS :: COMPONENT
!
   END TYPE STRUCT_TYPE
!-- ... and a variable of that type.
   TYPE(STRUCT_TYPE) :: STRUCT
!-- An external or dummy function with implicit interface
   PROCEDURE (REAL) :: PSI
end module m1

C:\gfortran\clf\opengl3>gfortran -c note12_15.f90
note12_15.f90:23.49:

      PROCEDURE (REAL_FUNC), POINTER :: COMPONENT
                                                 1
Error: Argument 'x' of 'component' with PASS(x) at (1) must be of the 
derived ty
pe 'struct_type'

Also in Note 11.13,

"A module and its submodules stand in a tree-like relationship one
to another, with the module at the root.  Therefore, a submodule has
exactly one ancestor module and may optionally have one or more
ancestor submodules."
^^^^^^^^ :)

-- 
write(*,*) transfer((/17.392111325966148d0,6.5794487871554595D-85, &
6.0134700243160014d-154/),(/'x'/)); end


0
Reply not_valid (1681) 1/19/2011 7:52:15 AM


0 Replies
87 Views

(page loaded in 0.152 seconds)

Similiar Articles:













7/14/2012 8:57:36 AM


Reply: