Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 16 Jun 2011 00:22:19 -0700
From:      Garrett Cooper <yanegomi@gmail.com>
To:        Tai-hwa Liang <avatar@freebsd.org>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r223139 - head/lib/libstand
Message-ID:  <BANLkTimG4svFzv1QPiKQcC7QdChLica9xA@mail.gmail.com>
In-Reply-To: <BANLkTi=X0_SBLAQ6t7amTLv7jF6_oXAV4Q@mail.gmail.com>
References:  <201106160714.p5G7Etfx017112@svn.freebsd.org> <BANLkTi=X0_SBLAQ6t7amTLv7jF6_oXAV4Q@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
On Thu, Jun 16, 2011 at 12:19 AM, Garrett Cooper <yanegomi@gmail.com> wrote:
> On Thu, Jun 16, 2011 at 12:14 AM, Tai-hwa Liang <avatar@freebsd.org> wrote:
>> Author: avatar
>> Date: Thu Jun 16 07:14:55 2011
>> New Revision: 223139
>> URL: http://svn.freebsd.org/changeset/base/223139
>>
>> Log:
>>  Unbreaking build on sparc64.
>>
>>  Submitted by: Garrett Cooper <yanegomi@gmail.com>
>>
>> Modified:
>>  head/lib/libstand/zalloc.c
>>
>> Modified: head/lib/libstand/zalloc.c
>> ==============================================================================
>> --- head/lib/libstand/zalloc.c  Thu Jun 16 05:26:03 2011        (r223138)
>> +++ head/lib/libstand/zalloc.c  Thu Jun 16 07:14:55 2011        (r223139)
>> @@ -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,%d): wild pointer", ptr, bytes);
>> +       panic("zfree(%p,%ju): wild pointer", ptr, bytes);
>
> All of those need to be cast to (uintmax_t). Sorry :(..

And you need to add #include <stdint.h> to stand.h in order to get
uintmax_t. Here's a proper patch for amd64..

Let me run this through make universe first though..

Thanks,
-Garrett

[-- Attachment #2 --]
Index: lib/libstand/zalloc.c
===================================================================
--- lib/libstand/zalloc.c	(revision 223140)
+++ lib/libstand/zalloc.c	(working copy)
@@ -154,7 +154,7 @@
     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
@@ -178,7 +178,8 @@
 		 * range check
 		 */
 		if ((char *)ptr + bytes > (char *)mn)
-		    panic("zfree(%p,%ju): corrupt memlist1",ptr, bytes);
+		    panic("zfree(%p,%ju): corrupt memlist1", ptr,
+		        (uintmax_t)bytes);
 
 		/*
 		 * merge against next area or create independant area
@@ -209,7 +210,8 @@
 		/* NOT REACHED */
 	    }
 	    if ((char *)ptr < (char *)mn + mn->mr_Bytes)
-		panic("zfree(%p,%ju): corrupt memlist2", ptr, bytes);
+		panic("zfree(%p,%ju): corrupt memlist2", ptr,
+		    (uintmax_t)bytes);
 	}
 	/*
 	 * We are beyond the last MemNode, append new MemNode.  Merge against
Index: lib/libstand/stand.h
===================================================================
--- lib/libstand/stand.h	(revision 223140)
+++ lib/libstand/stand.h	(working copy)
@@ -65,6 +65,7 @@
 #include <sys/cdefs.h>
 #include <sys/stat.h>
 #include <sys/dirent.h>
+#include <stdint.h>
 #include <string.h>
 
 #define CHK(fmt, args...)	printf("%s(%d): " fmt "\n", __func__, __LINE__ , ##args)

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?BANLkTimG4svFzv1QPiKQcC7QdChLica9xA>