On Feb 5, 2016, at 9:26 AM, Gilles Gouaillardet <gilles.gouaillar...@gmail.com> 
wrote:
> 
>  static inline opal_process_name_t ompi_proc_sentinel_to_name (intptr_t 
> sentinel)
> {
>  sentinel >>= 1;
>  sentinel &= 0x7FFFFFFFFFFFFFFF;
>  return *((opal_process_name_t *) &sentinel);
> }

I don't have much of an opinion on any of the other stuff here, but I note that 
this is unsafe.  I know we don't really care about non-64 bit these days, but 
we shouldn't be knowingly breaking it.  Instead of ANDing with a fixed 
constant, shouldn't it be something like:

intptr_t mask = ~1 >> 1;
sentinel &= mask;

-- 
Jeff Squyres
jsquy...@cisco.com
For corporate legal information go to: 
http://www.cisco.com/web/about/doing_business/legal/cri/

Reply via email to