From owner-cvs-src@FreeBSD.ORG Thu Dec 6 13:47:43 2007 Return-Path: Delivered-To: cvs-src@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id 9D40216A49A; Thu, 6 Dec 2007 13:47:43 +0000 (UTC) Date: Thu, 6 Dec 2007 13:47:43 +0000 From: Alexey Dokuchaev To: Max Khon Message-ID: <20071206134743.GA57446@FreeBSD.org> References: <200711232356.lANNu3mp040885@repoman.freebsd.org> <864pezer7f.fsf@ds4.des.no> <200712031657.34074.jhb@freebsd.org> <20071204172535.GB82261@FreeBSD.org> <4755BC3B.9040809@samodelkin.net> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <4755BC3B.9040809@samodelkin.net> User-Agent: Mutt/1.4.2.1i Cc: src-committers@freebsd.org, John Baldwin , cvs-src@freebsd.org, cvs-all@freebsd.org, John Birrell , Dag-Erling Sm??rgrav 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: Thu, 06 Dec 2007 13:47:43 -0000 On Wed, Dec 05, 2007 at 02:44:43AM +0600, Max Khon wrote: > Ho! > > Alexey Dokuchaev 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. > > Nope. Read man 1 gcc about -Wpointer-arith Right, I stand corrected. I've been thinking that ++/-- is kinda special. ./danfe