[ofw] [PATCH] opensm - add OSM_CDECL to qsort compare function definitions
Sean Hefty
sean.hefty at intel.com
Thu Oct 8 11:09:16 PDT 2009
>> ibping also requires the use __cdecl. So far, I've been maintaining
>> that patch separately and applying it before updating the winof code
>> base. If multiple users of __cdecl are required, maybe we can find
>> a common place for the definition.
>
>I don't get it - how can an ISO C conforming compiler require a
>non-standard declaration on the function argument to the ISO C
>function qsort?
The windows compiler uses stdcall as the default function type. With ibping,
the signal() call, and I'm guessing this is the same with qsort(), requires that
the function passed in as an arg be cdecl. So, in the case of ibping:
void report(int sig)
needs to be written as
void __cdecl report(int sig)
to compile for x86. I have no idea why only the x86 build that complains.
Since this is the only difference between the linux and windows code, I've just
maintained the patch to add it separately.
- Sean
More information about the ofw
mailing list