This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: bug in g77
- From: Toon Moene <toon at moene dot indiv dot nluug dot nl>
- To: Mark D LEAIR <mark dot leair at st dot com>
- Cc: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 06 Aug 2004 22:20:32 +0200
- Subject: Re: bug in g77
- Organization: Moene Computational Physics, Maartensdijk, NL
- References: <4113D6D1.7090607@st.com>
Mark D LEAIR wrote:
Hi,
It appears that g77 always converts a real function return value to
double precision. The following program illustrates this:
REAL FUNCTION FOO()
RFROMC = 50.0
RETURN
END
Indeed. See the discussion around the option -fno-f2c to force g77 to
give up f2c compatibility in this regard (because f2c - originally -
compiled to K&R defined C, it had to treat functions returning float as
functions returning double. You can override this behaviour, though.
Note that you have to compile *the whole program* and all its associate
libraries with this option, if you choose to use it.
URL:
http://gcc.gnu.org/onlinedocs/gcc-3.4.1/g77/Code-Gen-Options.html#Code%20Gen%20Options
Hope this helps,
--
Toon Moene - mailto:toon@moene.indiv.nluug.nl - phoneto: +31 346 214290
Saturnushof 14, 3738 XG Maartensdijk, The Netherlands
Maintainer, GNU Fortran 77: http://gcc.gnu.org/onlinedocs/g77_news.html
A maintainer of GNU Fortran 95: http://gcc.gnu.org/fortran/