From owner-cvs-all@FreeBSD.ORG Tue Dec 4 21:10:19 2007 Return-Path: Delivered-To: cvs-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B05EC16A418; Tue, 4 Dec 2007 21:10:19 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 6B51613C457; Tue, 4 Dec 2007 21:10:19 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.1/8.14.1) with ESMTP id lB4L4NWt011393; Tue, 4 Dec 2007 14:04:23 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Tue, 04 Dec 2007 14:08:21 -0700 (MST) Message-Id: <20071204.140821.-772295776.imp@bsdimp.com> To: max@love2party.net From: "M. Warner Losh" In-Reply-To: <200712041928.36391.max@love2party.net> References: <200712031657.34074.jhb@freebsd.org> <20071204172535.GB82261@FreeBSD.org> <200712041928.36391.max@love2party.net> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: danfe@FreeBSD.org, src-committers@FreeBSD.org, jhb@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org, jb@FreeBSD.org, des@des.no Subject: Re: cvs commit: src/sys/netinet/libalias alias_util.c 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: Tue, 04 Dec 2007 21:10:19 -0000 In message: <200712041928.36391.max@love2party.net> Max Laier writes: : On Tuesday 04 December 2007, Alexey Dokuchaev wrote: : > On Mon, Dec 03, 2007 at 04:57:33PM -0500, John Baldwin wrote: : > > On Monday 03 December 2007 10:24:52 am Dag-Erling Sm??rgrav wrote: : > > > John Birrell writes: : > > > > Log: : > > > > Fix strict alias warnings. : > > > : > > > A much simpler solution (relative to the previous revision): : > > > : > > > @@ -131,10 +131,10 @@ : > > > sum += oddbyte; : > > > } : > > > /* "Pseudo-header" data */ : > > > - ptr = (u_short *) & (pip->ip_dst); : > > > + ptr = (void *)&pip->ip_dst; : > > > sum += *ptr++; : > > > sum += *ptr; : > > > - ptr = (u_short *) & (pip->ip_src); : > > > + ptr = (void *)&pip->ip_src; : > > > sum += *ptr++; : > > > sum += *ptr; : > > > sum += htons((u_short) ntcp); : > > : > > *ptr++ would choke since pointer arith on (void *) is undefined : > > AFAIK. : > : > I've been under impression that ++ on void * whould simply increase it : > by one. : : wasn't that the reason why caddr_t exists? i.e. pointer arithmetic on : void * is bad, but on caddr_t it's kinda okay. Let's go look at the original code: u_short *ptr; and restate your objections... Warner