1

I have a simple program that should print the return value of a function. If the function contains a print statement, the program never terminates. Is this some kind of IO lock, generated from the outer print, that prevents the print inside the function to complete?

program print
  implicit none
  print *, func()
contains
  function func() result(res)
    integer   :: res
    res = 3
    print *, "jojo"
  end function
end program

0 Answers0