Jeremy,

On Sun, Sep 29, 2013 at 08:29:48AM -0700, Jeremy Huddleston Sequoia wrote:
> You had incorrect casting in the IN6_IS_ADDR_* macros.  Does Linux (or 
> whatever platform you tested on) cast the arguments to those macros for you 
> (thus correcting / undoing the casting that you provided)?  That seems quite 
> dangerous.
> 
> I initially reverted this but then noticed it was a trivial error and pushed 
> a commit with the fixed cast.
> 

Thanks! Good catch!

Unfortunately, with the semi-recent glibc on my Linux build machine 
at least, there are casts in both macros which will defeat any type 
checking whatsoever :(
Ie:

# define IN6_IS_ADDR_UNSPECIFIED(a) \
  (__extension__                                                              \
   ({ const struct in6_addr *__a = (const struct in6_addr *) (a);             \
      __a->s6_addr32[0] == 0                                                  \
      && __a->s6_addr32[1] == 0                                               \
      && __a->s6_addr32[2] == 0                                               \
      && __a->s6_addr32[3] == 0; }))

Cheers,
        Egbert.



_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to