subroutine print_int (i)
integer, intent (in) :: i(2)
print *, i
end subroutine print_int
program main
interface
subroutine print_int (i)
integer, intent (in) :: i(2)
end subroutine print_int
end interface
integer, allocatable :: foo(:,:)
allocate (foo(2,2))
foo(:,1) = [1, 2]
foo(:,2) = [3, 4]
call print_int (foo(:,2))
associate (bar => foo(:,2))
print *, bar
call print_int (bar)
end associate
end program
My expectation was that the three print statements that are executed by
this program would produce the same output. However, when I compile
with gfortran 4.7.0 20110514 and run it locally, the output I have looks
something like
3 4
3 4
33275912 0
where the first number of the last print statement varies for each call.
Looking at the standard it seems to me that this should be conforming,
but I'm still quite new to some of the terminology being used. Is this
code standard conforming?
For the records: works as intended with nagfor 5.2, no errors or
warnings (if -f2003 option set)
-- Wolfgang
--
E-mail: firstnameini...@domain.de
Domain: yahoo
>
> For the records: works as intended with nagfor 5.2, no errors or
> warnings (if -f2003 option set)
>
> -- Wolfgang
>
It also works as intended with ifort 12.0.4, no errors, warnings or
additional options required.
--
John
Using Opera's revolutionary email client: http://www.opera.com/mail/