cvs commit: src/sys/sys queue.h

Dag-Erling Smørgrav des at des.no
Sun Mar 5 00:43:35 PST 2006


Joseph Koshy <jkoshy at FreeBSD.org> writes:
> Maxime Henrion <mux at FreeBSD.org> writes:
> >   Log:
> >   Cast the pointer to void * before casting it back to struct type * in
> >   STAILQ_LAST.  This quiets a warning from GCC about increased required
> >   alignment for the cast.
> Doesn't this trade a compile time warning for a runtime fault on those
> architectures where alignment matters?

Unless the stailq head has been corrupted, we know that the result of
the expression is correctly aligned for a pointer to struct type.

DES
-- 
Dag-Erling Smørgrav - des at des.no


More information about the cvs-src mailing list