This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/25174] New: gfortran ignores explicit return type for functions
- From: "albertm at uphs dot upenn dot edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 30 Nov 2005 01:43:07 -0000
- Subject: [Bug fortran/25174] New: gfortran ignores explicit return type for functions
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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