Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program dafuq
- implicit none
- integer :: a=1
- integer, parameter :: b=2
- call foo(a,b)
- end program dafuq
- subroutine foo(a,b)
- implicit none
- integer, intent(inout) :: a, b
- a=b !OK
- b=a !causes segfault
- end subroutine foo
- program dafuq_array
- implicit none
- integer :: a(2)=(/1,1/)
- integer, parameter :: b(2)=(/2,2/)
- call foo(a,b)
- end program dafuq_array
- subroutine foo(a,b)
- implicit none
- integer, intent(inout) :: a(2), b(2)
- a=b !OK
- b=a !might cause segfault
- end subroutine foo
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement