This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: bug in g77


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]