"M. Warner Losh" <i...@bsdimp.com> writes:
> /*
>  * Macros to cast a struct sockaddr, or parts thereof.
>  * On architectures with strict alignment requirements, the compiler
>  * can bogusly warn about alignment problems since its static analysis
>  * is insufficient for it to know that with the APIs used, there
>  * really is no alignment issue.
>  */

That's a bit harsh on the compiler, don't you think?  It never pays to
hurt the compiler's feelings :)

> : @@ -2410,8 +2419,8 @@
> :                             }
> :                             reject = 0;
> :                             for (j = 0; j < 16; j += 4) {
> : -                                   if ((*(u_int32_t 
> *)&sin6->sin6_addr.s6_addr[j] & *(u_int32_t *)&m6p->sin6_addr.s6_addr[j])
> : -                                       != *(u_int32_t 
> *)&a6p->sin6_addr.s6_addr[j]) {
> : +                                   if 
> ((UINT32_CAST(sin6->sin6_addr.s6_addr[j]) & 
> UINT32_CAST(m6p->sin6_addr.s6_addr[j]))
> : +                                       != 
> UINT32_CAST(a6p->sin6_addr.s6_addr[j])) {
> :                                             ++reject;
> :                                             break;
> :                                     }
> : 
> : 
>
> Why 16 and 4 here?  What's so magical about them?

4 = bytes in a uint32_t, 16 = bytes in an ipv6 address.

DES
-- 
Dag-Erling Smørgrav - d...@des.no
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to