Re: dsm use of uint64 - Mailing list pgsql-hackers

From Robert Haas
Subject Re: dsm use of uint64
Date
Msg-id CA+TgmoZnpYZiWkg7NrY0kPquDVbVFTP+DGGLme+Xn=9Sj0s8DA@mail.gmail.com
Whole thread Raw
In response to Re: dsm use of uint64  (Andres Freund <andres@2ndquadrant.com>)
List pgsql-hackers
On Mon, Nov 4, 2013 at 10:55 AM, Andres Freund <andres@2ndquadrant.com> wrote:
>> Ah.  This is because I didn't change the format code used to print the
>> arguments; it's still using UINT64_FORMAT, but the argument is now a
>> Size.  What's the right way to print out a Size, anyway?
>
> There isn't a nice one currently. glibc/gcc have %z that automatically
> has the right width, but that's not supported by windows. I've been
> wondering if we shouldn't add support for that just like we have added
> support for %m.
>
>>  Should I
>> just try %lu?  It seems that sysv_shmem.c uses %lu, but also casts the
>> value to (unsigned long); I could follow that precedent here, if
>> there's no consistency to what format is needed to print a size_t.
>
> Yes, you need a cast like that.

Whee, portability is fun.  OK, I changed it to work that way.
Hopefully that'll do the trick.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Fast insertion indexes: why no developments
Next
From: Claudio Freire
Date:
Subject: Re: Fast insertion indexes: why no developments