This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Promoting floats to doubles?
- From: Kean Johnston <jkj at sco dot com>
- To: Jim Wilson <wilson at specifixinc dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Mon, 03 May 2004 18:15:26 -0700
- Subject: Re: Promoting floats to doubles?
- Organization: The SCO Group
- References: <409493B7.6040108@sco.com> <4096AE14.7000505@specifixinc.com>
If there is a prototype, and the prototype specifies float, then the
float will not be promoted to double.
It sounds like you have a prototype that disagrees with the function
definition, in which case you should fix the prototype.
It turns out I have a real problem on my hands. The OSR5 ABI
dictates that floats are always promoted to doubles. I know
thats bad and broken, but thats what I have. So even though
the prototypes are correct - for example, the particular
function that was causing the problem with g77 is prototyped
as extern float floorf (float), the OSR5 compiler, which was
used to produce libm, promoted the float arg to a double.
I guess one way around this would be to hack this with fixinc
and have it always change the prototypes from float to double.
I can't see any other way around this. Can you?
Kean