Re: [PATCH] libmlx4: Fix a compiler warning

2012-04-02 Thread Bart Van Assche
So we can't do this unconditionally. > > How about the patch below ? Sorry, but the patch I sent yesterday was wrong. Please replace by the patch below: [PATCH] libmlx4: Fix a compiler warning Avoid that link_local_gid() triggers the following compiler warning: dereferencin

Re: [PATCH] libmlx4: Fix a compiler warning

2012-04-01 Thread Bart Van Assche
o == 0) >> - return 1; >> + uint32_t hi = gid->u32[0]; >> + uint32_t lo = gid->u32[1]; > > Thanks, however I like to keep libmlx4 backwards compatible > if possible. So we can't do this unconditionally. How about the patch below ? [PATCH]

Re: [PATCH] libmlx4: Fix a compiler warning

2011-10-10 Thread Roland Dreier
On Mon, Oct 10, 2011 at 10:47 AM, Bart Van Assche wrote: > -       uint32_t hi = *(uint32_t *)(gid->raw); > -       uint32_t lo = *(uint32_t *)(gid->raw + 4); > -       if (hi == htonl(0xfe80) && lo == 0) > -               return 1; > +       uint32_t hi = gid->u32[0]; > +       uint32_t lo =

[PATCH] libmlx4: Fix a compiler warning

2011-10-10 Thread Bart Van Assche
Avoid that link_local_gid() triggers the following compiler warning: dereferencing type-punned pointer will break strict-aliasing rules Signed-off-by: Bart Van Assche --- src/verbs.c |8 +++- 1 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/verbs.c b/src/verbs.c index