Promoting floats to doubles?

Kean Johnston jkj@sco.com
Tue May 4 01:25:00 GMT 2004


> 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



More information about the Gcc mailing list