Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: IOKit: fabs() prototype missing, yet it complies...



I don't know where you are picking the definition up from as a quick grep in Kernel.framework indicates that there is no 'fabs' prototype anywhere.

If I had to guess I'd say it is a compiler built in. The compiler doesn't really get kernel development. We sort of bend it too our will but it resists occasionally I think this is one of those occasions.

In any case the question is moot. We compile all kext's with -msoft-float. You will not be able to get easy direct access to floating point in the kernel. The is not to say that you can't do floating point or even alti-vec in the kernel it is just difficult to setup the project.

Godfrey

At 12:14 -0500 02-3-12, Sean McBride wrote:
Once again I seem to be going crazy.... :) If I put the line:

double x = fabs (3.4);

in a skeleton test kext it compiles and links (did not try kextload).
Yet I cannot find the function prototype anywhere: I searched the entire
kernel.framework and its not there! (Actually I searched the entire
Frameworks dir, and fabs is only in some Carbon header). But if I change
the line to:

double x = fabs (3.4, 5.6);

I get the error "too many args to fn 'double fabs(double)'". So it knows
the correct prototype somehow. I am only #including IOService.h.

How can this be? If fabs() is unavailable (which I suspect) then surely
there should be an error.
_______________________________________________
darwin-development mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/darwin-development
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: missing IOLog (From: Ed Wynne <email@hidden>)
 >IOKit: fabs() prototype missing, yet it complies... (From: Sean McBride <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.