From owner-svn-src-head@FreeBSD.ORG Fri Jul 8 22:33:56 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4916A1065674; Fri, 8 Jul 2011 22:33:56 +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 DE02E8FC18; Fri, 8 Jul 2011 22:33:55 +0000 (UTC) Received: from 63.imp.bsdimp.com (63.imp.bsdimp.com [10.0.0.63]) (authenticated bits=0) by harmony.bsdimp.com (8.14.4/8.14.3) with ESMTP id p68MUc6M013873 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES128-SHA bits=128 verify=NO); Fri, 8 Jul 2011 16:30:38 -0600 (MDT) (envelope-from imp@bsdimp.com) Mime-Version: 1.0 (Apple Message framework v1084) From: Warner Losh In-Reply-To: Date: Fri, 8 Jul 2011 16:29:37 -0600 Message-Id: References: <201107080135.p681ZXZu087112@svn.freebsd.org> To: Craig Rodrigues X-Mailer: Apple Mail (2.1084) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (harmony.bsdimp.com [10.0.0.6]); Fri, 08 Jul 2011 16:30:38 -0600 (MDT) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Tai-hwa Liang , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r223854 - head/lib/libstand X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jul 2011 22:33:56 -0000 On Jul 8, 2011, at 2:25 AM, Craig Rodrigues wrote: > Hi, >=20 > While not ideal, would it be possible consider setting WARNS to set = different levels > depending on what the value of ${MACHINE_ARCH} is? >=20 > Something like: >=20 > .if ${MACHINE_ARCH} !=3D "sparc64" (or whatever the correct value is) > WARNS ?=3D 0 > .else > WARNS ?=3D 2 > .endif >=20 > This would at least be an attempt to prevent people from adding new > code to libstand which introduce new warnings. We've avoided this in the tree, and I'd urge against it. It gives a = false sense of security and tends to make problems linger. I'd like to = strongly argue against it. Warner > -- > Craig Rodrigues > rodrigc@crodrigues.org >=20 > On Thu, Jul 7, 2011 at 6:35 PM, Tai-hwa Liang = wrote: > Author: avatar > Date: Fri Jul 8 01:35:33 2011 > New Revision: 223854 > URL: http://svn.freebsd.org/changeset/base/223854 >=20 > Log: > Fixing building bustage on 32 bits platforms when WARNS >=3D 2. Note = that > this fix only applies to zalloc.c, the other part of libstand such = like > qdivrem.c still gives compilation warnings on sparc64 tinderbox = builds; > therefore, WARNS level isn't changed for now. >=20 > Submitted by: Garrett Cooper > Reviewed by: bde >=20 > Modified: > head/lib/libstand/zalloc.c > head/lib/libstand/zalloc_defs.h >=20 > Modified: head/lib/libstand/zalloc.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/lib/libstand/zalloc.c Fri Jul 8 01:32:04 2011 = (r223853) > +++ head/lib/libstand/zalloc.c Fri Jul 8 01:35:33 2011 = (r223854) > @@ -154,7 +154,7 @@ zfree(MemPool *mp, void *ptr, iaddr_t by > if ((char *)ptr < (char *)mp->mp_Base || > (char *)ptr + bytes > (char *)mp->mp_End || > ((iaddr_t)ptr & MEMNODE_SIZE_MASK) !=3D 0) > - panic("zfree(%p,%ju): wild pointer", ptr, bytes); > + panic("zfree(%p,%ju): wild pointer", ptr, (uintmax_t)bytes); >=20 > /* > * free the segment > @@ -177,8 +177,10 @@ zfree(MemPool *mp, void *ptr, iaddr_t by > /* > * range check > */ > - if ((char *)ptr + bytes > (char *)mn) > - panic("zfree(%p,%ju): corrupt memlist1",ptr, = bytes); > + if ((char *)ptr + bytes > (char *)mn) { > + panic("zfree(%p,%ju): corrupt memlist1", ptr, > + (uintmax_t)bytes); > + } >=20 > /* > * merge against next area or create independant area > @@ -208,8 +210,10 @@ zfree(MemPool *mp, void *ptr, iaddr_t by > return; > /* NOT REACHED */ > } > - if ((char *)ptr < (char *)mn + mn->mr_Bytes) > - panic("zfree(%p,%ju): corrupt memlist2", ptr, bytes); > + if ((char *)ptr < (char *)mn + mn->mr_Bytes) { > + panic("zfree(%p,%ju): corrupt memlist2", ptr, > + (uintmax_t)bytes); > + } > } > /* > * We are beyond the last MemNode, append new MemNode. Merge = against >=20 > Modified: head/lib/libstand/zalloc_defs.h > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/lib/libstand/zalloc_defs.h Fri Jul 8 01:32:04 2011 = (r223853) > +++ head/lib/libstand/zalloc_defs.h Fri Jul 8 01:35:33 2011 = (r223854) > @@ -39,6 +39,7 @@ > #define ZALLOCDEBUG >=20 > #include > +#include > #include "stand.h" >=20 > typedef uintptr_t iaddr_t; /* unsigned int same size as pointer = */ >=20 >=20 >=20 > --=20 > Craig Rodrigues > rodrigc@rodrigues.org >=20