gfortran 4.1.2 と gfortran 4.8.0 を使用して、次の単純なコードをコンパイルします。
function foo(a, b) result(res)
integer, intent(in) :: a, b
integer res
res = a+b
end function foo
program test
integer a, b, c
c = foo(a, b)
end program test
gfortran 4.1.2 は成功しますが、gfortran 4.8.0 では奇妙なエラーが発生します。
test.F90:14.11:
c = foo(a, b)
1
Error: Return type mismatch of function 'foo' at (1) (REAL(4)/INTEGER(4))
何か案が?