From owner-cvs-src@FreeBSD.ORG Wed Dec 5 23:53:34 2007 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5928616A41B; Wed, 5 Dec 2007 23:53:34 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from speedfactory.net (mail6.speedfactory.net [66.23.216.219]) by mx1.freebsd.org (Postfix) with ESMTP id 996A313C4FD; Wed, 5 Dec 2007 23:53:33 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (unverified [66.23.211.162]) by speedfactory.net (SurgeMail 3.8r) with ESMTP id 222941609-1834499 for multiple; Wed, 05 Dec 2007 18:53:38 -0500 Received: from localhost.corp.yahoo.com (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.13.8/8.13.8) with ESMTP id lB5NrOKP009532; Wed, 5 Dec 2007 18:53:25 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: "M. Warner Losh" Date: Wed, 5 Dec 2007 17:57:32 -0500 User-Agent: KMail/1.9.6 References: <200712031657.34074.jhb@freebsd.org> <200712041928.36391.max@love2party.net> <20071204.140821.-772295776.imp@bsdimp.com> In-Reply-To: <20071204.140821.-772295776.imp@bsdimp.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200712051757.33843.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Wed, 05 Dec 2007 18:53:26 -0500 (EST) X-Virus-Scanned: ClamAV 0.91.2/5015/Wed Dec 5 17:49:07 2007 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: danfe@freebsd.org, src-committers@freebsd.org, cvs-src@freebsd.org, cvs-all@freebsd.org, jb@freebsd.org, des@des.no, max@love2party.net Subject: Re: cvs commit: src/sys/netinet/libalias alias_util.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Dec 2007 23:53:34 -0000 On Tuesday 04 December 2007 04:08:21 pm M. Warner Losh wrote: > 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... Bah, brain-o on my part, sorry. -- John Baldwin