[ofw] Problem in building opensm with the 6001 compiler

Hal Rosenstock hal.rosenstock at gmail.com
Thu Sep 2 08:28:42 PDT 2010


Hi Tzachi,

On Thu, Sep 2, 2010 at 10:14 AM, Tzachi Dar <tzachid at mellanox.co.il> wrote:
> Hi,
>
>
>
> It seems that we are having a problem to build our code with the 6001
> compiler (on 2003-64 bits).
>
> The problem is on the file osm_vendor_ibumad.c line 89 and 185
>

Do you mean osm_vendor_ibumad_sa.c rather than osm_vendor_ibumad.c ?

>
> We saw that the files can be built with the new compiler, but we believe
> that there is a real problem here:
>
> osmv_query_req_t *p_query_req_copy = NULL;
>
>>
>
>
>                 /* obtain the sent context since we store it during send in
> the ni_ctx */
>
>                 p_query_req_copy =
>
>                     (osmv_query_req_t *) (long
> *)(long)(p_req_madw->context.ni_context.
>
>
> node_guid);
>

It looks to me like the Windows code here is identical to the Linux version.

The syntax predates the git log history.

>
>
> We start with a node_guid that is 64 bits convert it to long that is 32
> bits,  (information is lost).
>
> Next we move to 64 bits (no data lost) and then we put it on
> p_query_req_copy.
>
>
>
> Please note that since we end with a pointer, it is not clear what should
> happen, since on 32 bits, information will be lost.
>

I don't have an explanation for why it's done this way but I'm not
sure whether there is information loss. I think it depends on the
compiler. It clearly is awkward and could be improved.

I think the following comment explains what it's trying to do:

  A pointer to the actual context of the request (a copy of the oriignal
  request structure) is attached as the p_madw->context.ni_context.node_guid

-- Hal

>
> Thanks
>
> Tzachi
>
> _______________________________________________
> ofw mailing list
> ofw at lists.openfabrics.org
> http://lists.openfabrics.org/cgi-bin/mailman/listinfo/ofw
>



More information about the ofw mailing list