Print

Print


Last week I posted a question about INTENT as it pertains to pointer
components of a derived-type dummy argument.  The answer was that the
INTENT applies to the association status of the pointer component and
not to its target.  Can one of you experts provide the reference in
the F95 standard where this is stated?  (I don't have access to a copy.)
I'm having a discussion with a compiler vendor who insists that their
interpretation (INTENT applies to the target) is correct, and that
other compilers do the same.  He claims he can't find it in the
standard anywhere.  It's clearly stated in M&R, but I doubt he'll
accept this as authoritative.

For reference, here's the example I believe is standard conforming:

  module intent_bug
    type :: my_type
      real, dimension(:), pointer :: x => null()
    end type my_type
  contains
    subroutine legal_sub (a)
      type(my_type), intent(in) :: a
      a % x = 0.0   ! this is legal: the association status of a%x is
                    ! unmodified
    end subroutine legal_sub
  end module intent_bug

I'm also curious what the latest versions of other compilers do; I only
have access to two, one is correct and the other isn't (as I understand
it at this time).

Thanks for your help!

  Neil

--
Neil N. Carlson                    Motorola, Los Alamos Research Park
Motorola Labs / PSRL               4200 W. Jemez Road, Suite 300
Computational Nanoscience Group    Los Alamos, New Mexico 87544

[log in to unmask]           Fax: (505) 663-5150
Voice: (505) 663-5106              Pager: [log in to unmask] or
888-946-2817