From owner-cvs-all@FreeBSD.ORG Sat Mar 4 15:42:59 2006 Return-Path: X-Original-To: cvs-all@FreeBSD.org Delivered-To: cvs-all@FreeBSD.org Received: by hub.freebsd.org (Postfix, from userid 729) id 8A7BE16A422; Sat, 4 Mar 2006 15:42:59 +0000 (GMT) X-Mailer: exmh version 2.7.0 06/18/2004 with nmh-1.0.4 To: Maxime Henrion In-Reply-To: Message from Maxime Henrion of "Fri, 03 Mar 2006 18:54:33 GMT." <200603031854.k23IsXeJ062568@repoman.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain Message-Id: <20060304154259.8A7BE16A422@hub.freebsd.org> Date: Sat, 4 Mar 2006 15:42:59 +0000 (GMT) From: jkoshy@FreeBSD.ORG (Joseph Koshy) Cc: cvs-src@FreeBSD.org, src-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/sys queue.h X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Mar 2006 15:42:59 -0000 > mux 2006-03-03 18:54:33 UTC > > FreeBSD src repository > > Modified files: > sys/sys queue.h > 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. > > Idea from: cognet Doesn't this trade a compile time warning for a runtime fault on those architectures where alignment matters? Which code triggers this warning? 274 #define STAILQ_LAST(head, type, field) \ 275 (STAILQ_EMPTY((head)) ? \ 276 NULL : \ 277 ((struct type *) \ 278 ((char *)((head)->stqh_last) - __offsetof(struct type, field)))) I can't see how this code would trigger a warning in normal usage. Regards, Koshy