Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 16 Jun 2011 18:16:47 +1000 (EST)
From:      Bruce Evans <brde@optusnet.com.au>
To:        Garrett Cooper <yanegomi@gmail.com>
Cc:        Tai-hwa Liang <avatar@freebsd.org>, svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r223139 - head/lib/libstand
Message-ID:  <20110616180803.D1005@besplex.bde.org>
In-Reply-To: <BANLkTimG4svFzv1QPiKQcC7QdChLica9xA@mail.gmail.com>
References:  <201106160714.p5G7Etfx017112@svn.freebsd.org> <BANLkTi=X0_SBLAQ6t7amTLv7jF6_oXAV4Q@mail.gmail.com> <BANLkTimG4svFzv1QPiKQcC7QdChLica9xA@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

--0-2089999118-1308212207=:1005
Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed
Content-Transfer-Encoding: QUOTED-PRINTABLE

On Thu, 16 Jun 2011, Garrett Cooper wrote:

> On Thu, Jun 16, 2011 at 12:19 AM, Garrett Cooper <yanegomi@gmail.com> wro=
te:
>> On Thu, Jun 16, 2011 at 12:14 AM, Tai-hwa Liang <avatar@freebsd.org> wro=
te:
>>> Author: avatar
>>> Date: Thu Jun 16 07:14:55 2011
>>> New Revision: 223139
>>> URL: http://svn.freebsd.org/changeset/base/223139
>>>
>>> Log:
>>> =A0Unbreaking build on sparc64.

Why not fix it on all arches?  This seems to break it on all 32-bit arches.

>>> =A0Submitted by: Garrett Cooper <yanegomi@gmail.com>
>>>
>>> Modified:
>>> =A0head/lib/libstand/zalloc.c
>>>
>>> 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 =A0Thu Jun 16 05:26:03 2011 =A0 =A0 =A0 =
=A0(r223138)
>>> +++ head/lib/libstand/zalloc.c =A0Thu Jun 16 07:14:55 2011 =A0 =A0 =A0 =
=A0(r223139)
>>> @@ -154,7 +154,7 @@ zfree(MemPool *mp, void *ptr, iaddr_t by
>>> =A0 =A0 if ((char *)ptr < (char *)mp->mp_Base ||
>>> =A0 =A0 =A0 =A0(char *)ptr + bytes > (char *)mp->mp_End ||
>>> =A0 =A0 =A0 =A0((iaddr_t)ptr & MEMNODE_SIZE_MASK) !=3D 0)
>>> - =A0 =A0 =A0 panic("zfree(%p,%d): wild pointer", ptr, bytes);
>>> + =A0 =A0 =A0 panic("zfree(%p,%ju): wild pointer", ptr, bytes);
>>
>> All of those need to be cast to (uintmax_t). Sorry :(..

Indeed.  There is no format letter for intptr_t, and perhaps iaddr_t is
supposed to be opaque anyway.

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

This would add namespace pollution.  stand.h doesn't use anything in
<stdint.h>.  It depends on normal namespace pollution in an XXX section
in <sys/types.h> for the declaration of uintptr_t.  It and other headers
should use __uintptr_t instead.  Strangely, <sys/types.h> declares
uintptr_t but not uintmax_t.

Bruce
--0-2089999118-1308212207=:1005--



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