[ofw] RE: [PATCH] osmtest - Add OSM_CDECL to main() declaration

Smith, Stan stan.smith at intel.com
Mon Oct 12 14:58:02 PDT 2009


Sasha Khapyorsky wrote:
> On 10:10 Mon 12 Oct     , Stan C. Smith wrote:
>>
>>
>> Signed-off-by: stan smith <stan.smith at intel.com>
>>
>> diff --git a/opensm/osmtest/main.c b/opensm/osmtest/main.c
>> index 4bb9f82..287baf3 100644
>> --- a/opensm/osmtest/main.c
>> +++ b/opensm/osmtest/main.c
>> @@ -285,7 +285,7 @@ ib_net64_t get_port_guid(IN osmtest_t * p_osmt,
>> uint64_t port_guid)
>>
>>  /**********************************************************************
>>
>> **********************************************************************/
>> -int main(int argc, char *argv[]) +int OSM_CDECL main(int argc, char
>> *argv[])
>
> Hmm, why is this needed? AFAIK most of infiniband-diags tools were
> ported to windows without adding such special declaration for main()
> functions.
>
> Sasha
>
>>  {
>>      static osmtest_t osm_test;
>>      osmtest_opt_t opt = { 0 };

Sean maintains a separate set of patches applied to IB diags in order to address issues like the x86 requirement for __cdecl on main().
Since OSM_CDECL was already defined in OFED opensm, it did not seem to be a major concession to prefix main() with it.
Options:
1) utilize OSM_CDECL
2) throw an ugly ifdef __WIN__ or ifdef __linux__ around main()
3) Create more Windows-only patches required for the Windows implementation of OFED opensm & tools.

Your call.




More information about the ofw mailing list