gfortran seems to ignore explicit return types of functions. Example follows: -----------------------------bug.for-------------------------------- PROGRAM BUG external real function Mfunc real*4 X,Y
X = Xfunc() Y = Mfunc() write(6,*) X,Y stop end real function Xfunc() Xfunc = 17.232 return end real function Mfunc() Mfunc = 17.232 return end -----------------------------bug.for------------------------------ When run, this gives: 17.23200 1.0995535E+09 STOP 0 Compilation was: [...]/gfortran -Wall -o bug bug.for -L[...]/lib64 \ -Wl,-rpath,[...]/lib64 (Long path names replaced with [...]). As usual, thank you very much. The gcc collection is a wonderful tool. -Mike -- Summary: gfortran ignores explicit return type for functions Product: gcc Version: 4.0.2 Status: UNCONFIRMED Severity: major Priority: P3 Component: fortran AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: albertm at uphs dot upenn dot edu GCC host triplet: x86_64-unknown-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25174