You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by Joe Orton <jo...@redhat.com> on 2007/10/29 12:32:17 UTC
Re: svn commit: r588061 - in /apr/apr/trunk/include: apr.h.in
apr.hnw apr.hw
On Wed, Oct 24, 2007 at 10:28:24PM -0000, William Rowe wrote:
> Author: wrowe
> Date: Wed Oct 24 15:28:18 2007
> New Revision: 588061
>
> URL: http://svn.apache.org/viewvc?rev=588061&view=rev
> Log:
> Perhaps smaller than long, perhaps larger than long,
> let's let ~ bit flipping work this out for us.
I don't suppose it is possible that any platform exists with a signed
size_t?
I know it sounds crazy; APR does use hard-code %ld as size_t_fmt for a
few platforms rather than %lu, maybe that is just a bug.
>
> Modified:
> apr/apr/trunk/include/apr.h.in
> apr/apr/trunk/include/apr.hnw
> apr/apr/trunk/include/apr.hw
>
> Modified: apr/apr/trunk/include/apr.h.in
> URL: http://svn.apache.org/viewvc/apr/apr/trunk/include/apr.h.in?rev=588061&r1=588060&r2=588061&view=diff
> ==============================================================================
> --- apr/apr/trunk/include/apr.h.in (original)
> +++ apr/apr/trunk/include/apr.h.in Wed Oct 24 15:28:18 2007
> @@ -348,6 +348,9 @@
> #define APR_UINT64_MAX APR_UINT64_C(0xffffffffffffffff)
> #endif
>
> +#define APR_SIZE_MAX (~((apr_size_t)0))
> +
> +
> /* Definitions that APR programs need to work properly. */
>
> /**
>
> Modified: apr/apr/trunk/include/apr.hnw
> URL: http://svn.apache.org/viewvc/apr/apr/trunk/include/apr.hnw?rev=588061&r1=588060&r2=588061&view=diff
> ==============================================================================
> --- apr/apr/trunk/include/apr.hnw (original)
> +++ apr/apr/trunk/include/apr.hnw Wed Oct 24 15:28:18 2007
> @@ -325,6 +325,8 @@
> #define APR_UINT64_MAX APR_UINT64_C(0xffffffffffffffff)
> #endif
>
> +#define APR_SIZE_MAX (~((apr_size_t)0))
> +
> /* PROC mutex is a GLOBAL mutex on Netware */
> #define APR_PROC_MUTEX_IS_GLOBAL 1
>
>
> Modified: apr/apr/trunk/include/apr.hw
> URL: http://svn.apache.org/viewvc/apr/apr/trunk/include/apr.hw?rev=588061&r1=588060&r2=588061&view=diff
> ==============================================================================
> --- apr/apr/trunk/include/apr.hw (original)
> +++ apr/apr/trunk/include/apr.hw Wed Oct 24 15:28:18 2007
> @@ -430,6 +430,8 @@
> #define APR_UINT64_MAX APR_UINT64_C(0xffffffffffffffff)
> #endif
>
> +#define APR_SIZE_MAX (~((apr_size_t)0))
> +
> #if APR_HAVE_IPV6
>
> /* Appears in later flavors, not the originals. */
>
Re: svn commit: r588061 - in /apr/apr/trunk/include: apr.h.in apr.hnw apr.hw
Posted by Jeff Trawick <tr...@gmail.com>.
On 10/29/07, Joe Orton <jo...@redhat.com> wrote:
> On Wed, Oct 24, 2007 at 10:28:24PM -0000, William Rowe wrote:
> > Author: wrowe
> > Date: Wed Oct 24 15:28:18 2007
> > New Revision: 588061
> >
> > URL: http://svn.apache.org/viewvc?rev=588061&view=rev
> > Log:
> > Perhaps smaller than long, perhaps larger than long,
> > let's let ~ bit flipping work this out for us.
>
> I don't suppose it is possible that any platform exists with a signed
> size_t?
>
> I know it sounds crazy; APR does use hard-code %ld as size_t_fmt for a
> few platforms rather than %lu, maybe that is just a bug.
I'll fix the AIX definition of size_t_fmt later today.
Re: svn commit: r588061 - in /apr/apr/trunk/include: apr.h.in apr.hnw apr.hw
Posted by Jim Jagielski <ji...@jaguNET.com>.
On Oct 29, 2007, at 2:59 PM, William A. Rowe, Jr. wrote:
> Joe Orton wrote:
>> On Wed, Oct 24, 2007 at 10:28:24PM -0000, William Rowe wrote:
>>> Author: wrowe
>>> Date: Wed Oct 24 15:28:18 2007
>>> New Revision: 588061
>>>
>>> URL: http://svn.apache.org/viewvc?rev=588061&view=rev
>>> Log:
>>> Perhaps smaller than long, perhaps larger than long,
>>> let's let ~ bit flipping work this out for us.
>> I don't suppose it is possible that any platform exists with a
>> signed size_t?
>
> That would violate K&R all the way through POSIX 99 C, so it's an
> edge case
> we should simply ignore. ssize_t is a little more modern, but
> still almost
> 20 years old.
>
IIRC, size_t started with ANSI... IN K&R, there was no real
size_t; sizeof() returned, basically, an "integer constant",
and stdlib.h was an ANSI addition...
Re: svn commit: r588061 - in /apr/apr/trunk/include: apr.h.in apr.hnw
apr.hw
Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
Joe Orton wrote:
> On Wed, Oct 24, 2007 at 10:28:24PM -0000, William Rowe wrote:
>> Author: wrowe
>> Date: Wed Oct 24 15:28:18 2007
>> New Revision: 588061
>>
>> URL: http://svn.apache.org/viewvc?rev=588061&view=rev
>> Log:
>> Perhaps smaller than long, perhaps larger than long,
>> let's let ~ bit flipping work this out for us.
>
> I don't suppose it is possible that any platform exists with a signed
> size_t?
That would violate K&R all the way through POSIX 99 C, so it's an edge case
we should simply ignore. ssize_t is a little more modern, but still almost
20 years old.
Bill
Re: svn commit: r588061 - in /apr/apr/trunk/include: apr.h.in apr.hnw apr.hw
Posted by Lucian Adrian Grijincu <lu...@gmail.com>.
On 10/29/07, Jim Jagielski <ji...@jagunet.com> wrote:
>
> On Oct 29, 2007, at 7:32 AM, Joe Orton wrote:
>
> > On Wed, Oct 24, 2007 at 10:28:24PM -0000, William Rowe wrote:
> >> Author: wrowe
> >> Date: Wed Oct 24 15:28:18 2007
> >> New Revision: 588061
> >>
> >> URL: http://svn.apache.org/viewvc?rev=588061&view=rev
> >> Log:
> >> Perhaps smaller than long, perhaps larger than long,
> >> let's let ~ bit flipping work this out for us.
> >
> > I don't suppose it is possible that any platform exists with a signed
> > size_t?
> >
> > I know it sounds crazy; APR does use hard-code %ld as size_t_fmt for a
> > few platforms rather than %lu, maybe that is just a bug.
> >
>
> I seem to recall that size_t by definition was unsigned, but
> I can't find that ref.
>
>
"size_t shall be an unsigned integer type."
http://www.opengroup.org/onlinepubs/009695399/basedefs/sys/types.h.html
--
Lucian
Re: svn commit: r588061 - in /apr/apr/trunk/include: apr.h.in apr.hnw apr.hw
Posted by Jim Jagielski <ji...@jaguNET.com>.
On Oct 29, 2007, at 7:32 AM, Joe Orton wrote:
> On Wed, Oct 24, 2007 at 10:28:24PM -0000, William Rowe wrote:
>> Author: wrowe
>> Date: Wed Oct 24 15:28:18 2007
>> New Revision: 588061
>>
>> URL: http://svn.apache.org/viewvc?rev=588061&view=rev
>> Log:
>> Perhaps smaller than long, perhaps larger than long,
>> let's let ~ bit flipping work this out for us.
>
> I don't suppose it is possible that any platform exists with a signed
> size_t?
>
> I know it sounds crazy; APR does use hard-code %ld as size_t_fmt for a
> few platforms rather than %lu, maybe that is just a bug.
>
I seem to recall that size_t by definition was unsigned, but
I can't find that ref.