davidb
Joined: 17 Jul 2009 Posts: 560 Location: UK
|
Posted: Tue Jul 23, 2013 6:46 am Post subject: Warning 1093 - What does it mean |
|
|
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.
Code: |
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
|
_________________ Programmer in: Fortran 77/95/2003/2008, C, C++ (& OpenMP), java, Python, Perl |
|