This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: bug in g77
- From: Mark D LEAIR <mark dot leair at st dot com>
- To: Toon Moene <toon at moene dot indiv dot nluug dot nl>
- Cc: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 06 Aug 2004 13:52:52 -0700
- Subject: Re: bug in g77
- Organization: ST Microelectronics, AST Portland Lab
- References: <4113D6D1.7090607@st.com> <4113E810.109@moene.indiv.nluug.nl>
Thank you for your reply. We had a feeling that there was an option to
disable this but could not track it down.
-Mark
Toon Moene wrote:
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,
--
Mark Leair - Software Engineer mark.leair@st.com
Advanced Compilers & Tools Ph: +1-503-682-2806
AST Portland Laboratory, STMicroelectronics Fx: +1-503-682-2637
Wilsonville, OR 97070 USA