Advertisement
Guest User

Untitled

a guest
Jun 30th, 2015
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. program dafuq
  2. implicit none
  3. integer :: a=1
  4. integer, parameter :: b=2
  5.  
  6. call foo(a,b)
  7. end program dafuq
  8.  
  9. subroutine foo(a,b)
  10. implicit none
  11. integer, intent(inout) :: a, b
  12.  
  13. a=b !OK
  14. b=a !causes segfault
  15.  
  16. end subroutine foo
  17.  
  18. program dafuq_array
  19. implicit none
  20. integer :: a(2)=(/1,1/)
  21. integer, parameter :: b(2)=(/2,2/)
  22.  
  23. call foo(a,b)
  24. end program dafuq_array
  25.  
  26. subroutine foo(a,b)
  27. implicit none
  28. integer, intent(inout) :: a(2), b(2)
  29.  
  30. a=b !OK
  31. b=a !might cause segfault
  32.  
  33. end subroutine foo
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement