Silverfrost Forums

Welcome to our forums

Warning 1093 - What does it mean

23 Jul 2013 5:46 #12680

With the following code, the compiler issues a warning

warning 1093 - TARGET attribute used where POINTER may be preferred

What is the reason for this? Note that A POINTER cannot be used since the actual argument is not a POINTER.

One possibiliy is the warning means something like:

warning 1093 - The actual argument must be contiguous when the TARGET attribute is used on the dummay argument.

module mmm

   type xxx_t
      sequence
      real :: q
   end type xxx_t
     
contains

   subroutine sss(a)
      type(xxx_t), intent(inout), target :: a(:)
      real, pointer :: p
      do i=1, size(a)
        p => a(i)%q
        p = real(i)
      end do
   end subroutine sss

end module mmm

program anon

   use mmm
   type(xxx_t), allocatable :: a(:)
   allocate(a(10))
   call sss(a)
   print *, a%q

end program anon
23 Jul 2013 10:58 #12682

I don't know what this means but intuitively I would not use TARGET in this context.

Please login to reply.