From owner-svn-src-head@FreeBSD.ORG Fri Jul 8 08:49:31 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 D2947106564A; Fri, 8 Jul 2011 08:49:31 +0000 (UTC) (envelope-from crodr001@gmail.com) Received: from mail-yi0-f54.google.com (mail-yi0-f54.google.com [209.85.218.54]) by mx1.freebsd.org (Postfix) with ESMTP id 5A0E98FC13; Fri, 8 Jul 2011 08:49:31 +0000 (UTC) Received: by yic13 with SMTP id 13so883680yic.13 for ; Fri, 08 Jul 2011 01:49:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=ozgdtwGVC1whW4kOgqdq8PuXmWZyRN/kbw3gVkoiDDw=; b=gNfnpNszykOqsazc/siEgjTOUAfgOmx5znWGdtHGH8clo2MxOM7zue8APMQGxCUc8j vX1m5FgOW+u9h7fnzDD9yoZQaHueW0p3XuyO15wy1wl/Ofbyh39hvRWza0CcTjE/JEOd Pgam1DtiAfRjzrpndEfP6ptQp/o748ZKphEOE= MIME-Version: 1.0 Received: by 10.101.26.30 with SMTP id d30mr1422620anj.125.1310113531870; Fri, 08 Jul 2011 01:25:31 -0700 (PDT) Sender: crodr001@gmail.com Received: by 10.100.92.8 with HTTP; Fri, 8 Jul 2011 01:25:31 -0700 (PDT) In-Reply-To: <201107080135.p681ZXZu087112@svn.freebsd.org> References: <201107080135.p681ZXZu087112@svn.freebsd.org> Date: Fri, 8 Jul 2011 01:25:31 -0700 X-Google-Sender-Auth: ZPD5_YRSNVCw-uL8-AwK5UZSYac Message-ID: From: Craig Rodrigues To: Tai-hwa Liang Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: 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 08:49:31 -0000 Hi, While not ideal, would it be possible consider setting WARNS to set different levels depending on what the value of ${MACHINE_ARCH} is? Something like: .if ${MACHINE_ARCH} != "sparc64" (or whatever the correct value is) WARNS ?= 0 .else WARNS ?= 2 .endif This would at least be an attempt to prevent people from adding new code to libstand which introduce new warnings. -- Craig Rodrigues rodrigc@crodrigues.org 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 > > Log: > Fixing building bustage on 32 bits platforms when WARNS >= 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. > > Submitted by: Garrett Cooper > Reviewed by: bde > > Modified: > head/lib/libstand/zalloc.c > head/lib/libstand/zalloc_defs.h > > Modified: head/lib/libstand/zalloc.c > > ============================================================================== > --- 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) != 0) > - panic("zfree(%p,%ju): wild pointer", ptr, bytes); > + panic("zfree(%p,%ju): wild pointer", ptr, (uintmax_t)bytes); > > /* > * 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); > + } > > /* > * 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 > > Modified: head/lib/libstand/zalloc_defs.h > > ============================================================================== > --- 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 > > #include > +#include > #include "stand.h" > > typedef uintptr_t iaddr_t; /* unsigned int same size as pointer */ > -- Craig Rodrigues rodrigc@rodrigues.org