All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] osmtest - Add OSM_CDECL to main() declaration
@ 2009-10-12 17:10 Stan C. Smith
  2009-10-12 21:43 ` Sasha Khapyorsky
  0 siblings, 1 reply; 7+ messages in thread
From: Stan C. Smith @ 2009-10-12 17:10 UTC (permalink / raw)
  To: 'Sasha Khapyorsky'; +Cc: ofw, 'linux-rdma'



Signed-off-by: stan smith <stan.smith@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[])
 {
 	static osmtest_t osm_test;
 	osmtest_opt_t opt = { 0 };

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] osmtest - Add OSM_CDECL to main() declaration
  2009-10-12 17:10 [PATCH] osmtest - Add OSM_CDECL to main() declaration Stan C. Smith
@ 2009-10-12 21:43 ` Sasha Khapyorsky
  2009-10-12 21:58   ` Smith, Stan
  0 siblings, 1 reply; 7+ messages in thread
From: Sasha Khapyorsky @ 2009-10-12 21:43 UTC (permalink / raw)
  To: Stan C. Smith; +Cc: ofw, 'linux-rdma'

On 10:10 Mon 12 Oct     , Stan C. Smith wrote:
> 
> 
> Signed-off-by: stan smith <stan.smith@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 };
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: [PATCH] osmtest - Add OSM_CDECL to main() declaration
  2009-10-12 21:43 ` Sasha Khapyorsky
@ 2009-10-12 21:58   ` Smith, Stan
  2009-10-12 22:18     ` Sasha Khapyorsky
  0 siblings, 1 reply; 7+ messages in thread
From: Smith, Stan @ 2009-10-12 21:58 UTC (permalink / raw)
  To: Sasha Khapyorsky; +Cc: ofw, 'linux-rdma'

Sasha Khapyorsky wrote:
> On 10:10 Mon 12 Oct     , Stan C. Smith wrote:
>>
>>
>> Signed-off-by: stan smith <stan.smith@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.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] osmtest - Add OSM_CDECL to main() declaration
  2009-10-12 21:58   ` Smith, Stan
@ 2009-10-12 22:18     ` Sasha Khapyorsky
  2009-10-12 22:28       ` Smith, Stan
  2009-10-15  4:57       ` Sean Hefty
  0 siblings, 2 replies; 7+ messages in thread
From: Sasha Khapyorsky @ 2009-10-12 22:18 UTC (permalink / raw)
  To: Smith, Stan; +Cc: ofw, 'linux-rdma'

On 14:58 Mon 12 Oct     , Smith, Stan wrote:
> >
> >>  {
> >>      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.

Any options for windows compiler about call conventions?

Sasha

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: [PATCH] osmtest - Add OSM_CDECL to main() declaration
  2009-10-12 22:18     ` Sasha Khapyorsky
@ 2009-10-12 22:28       ` Smith, Stan
  2009-10-15  4:57       ` Sean Hefty
  1 sibling, 0 replies; 7+ messages in thread
From: Smith, Stan @ 2009-10-12 22:28 UTC (permalink / raw)
  To: Sasha Khapyorsky; +Cc: ofw, 'linux-rdma'

Sasha Khapyorsky wrote:
> On 14:58 Mon 12 Oct     , Smith, Stan wrote:
>>>
>>>>  {
>>>>      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.
>
> Any options for windows compiler about call conventions?
>
> Sasha

Sadly not for x86 architecture on Windows. Both Sean and I have danced around this and come up empty.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: Re: [PATCH] osmtest - Add OSM_CDECL to main() declaration
  2009-10-12 22:18     ` Sasha Khapyorsky
  2009-10-12 22:28       ` Smith, Stan
@ 2009-10-15  4:57       ` Sean Hefty
  2009-10-15 19:41         ` Smith, Stan
  1 sibling, 1 reply; 7+ messages in thread
From: Sean Hefty @ 2009-10-15  4:57 UTC (permalink / raw)
  To: 'Sasha Khapyorsky', Smith, Stan; +Cc: ofw, 'linux-rdma'

>> 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.
>
>Any options for windows compiler about call conventions?

To clarify, I maintain a single patch to handle this for the signal() callback
handler, not the ib-diags main() functions.

Here's what I use in the sources file for building the diags:

MSC_WARNING_LEVEL = /W3 /WX /wd4007

- Sean

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: Re: [PATCH] osmtest - Add OSM_CDECL to main() declaration
  2009-10-15  4:57       ` Sean Hefty
@ 2009-10-15 19:41         ` Smith, Stan
  0 siblings, 0 replies; 7+ messages in thread
From: Smith, Stan @ 2009-10-15 19:41 UTC (permalink / raw)
  To: Hefty, Sean, 'Sasha Khapyorsky'; +Cc: ofw, 'linux-rdma'

Hefty, Sean wrote:
>>> 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.
>>
>> Any options for windows compiler about call conventions?
>
> To clarify, I maintain a single patch to handle this for the signal()
> callback handler, not the ib-diags main() functions.
>
> Here's what I use in the sources file for building the diags:
>
> MSC_WARNING_LEVEL = /W3 /WX /wd4007
>
> - Sean

Thanks for sharing the info at your earliest convenience.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2009-10-15 19:41 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-12 17:10 [PATCH] osmtest - Add OSM_CDECL to main() declaration Stan C. Smith
2009-10-12 21:43 ` Sasha Khapyorsky
2009-10-12 21:58   ` Smith, Stan
2009-10-12 22:18     ` Sasha Khapyorsky
2009-10-12 22:28       ` Smith, Stan
2009-10-15  4:57       ` Sean Hefty
2009-10-15 19:41         ` Smith, Stan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.