This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/30411] gfortran MODULE bug for non trivial data types
- From: "kargl at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 9 Jan 2007 01:26:40 -0000
- Subject: [Bug fortran/30411] gfortran MODULE bug for non trivial data types
- References: <bug-30411-13882@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from kargl at gcc dot gnu dot org 2007-01-09 01:26 -------
If you move the module unit above the main program, so that the
module has been compiled by the time the main USEs it, then with
gfortran 4.3.0 I get
laptop:kargl[211] gfc4x -c n.f
n.f: In function 'distance':
n.f:5: warning: Function return value not set
n.f:26.22:
L=Distance(Point1,Point2)
1
Error: Type/rank mismatch in argument 'point1' at (1)
which is correct. Furthermore, if I move the define of
the derived above the CONTAINS and remove the private
version in the function and subroutine, I get
laptop:kargl[217] gfc4x -c n.f
n.f: In function 'distance':
n.f:10: warning: Function return value not set
which is the expected output.
In short, grab a newer version of gfortran from the gfortran
wiki or build gfortran for the 4.2 or 4.3 branch. Additionally,
your code needs some improvements.
--
kargl at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |kargl at gcc dot gnu dot org
Status|UNCONFIRMED |WAITING
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30411