postgresql/src/backend
Tom Lane ac4ef637ad Allow use of "z" flag in our printf calls, and use it where appropriate.
Since C99, it's been standard for printf and friends to accept a "z" size
modifier, meaning "whatever size size_t has".  Up to now we've generally
dealt with printing size_t values by explicitly casting them to unsigned
long and using the "l" modifier; but this is really the wrong thing on
platforms where pointers are wider than longs (such as Win64).  So let's
start using "z" instead.  To ensure we can do that on all platforms, teach
src/port/snprintf.c to understand "z", and add a configure test to force
use of that implementation when the platform's version doesn't handle "z".

Having done that, modify a bunch of places that were using the
unsigned-long hack to use "z" instead.  This patch doesn't pretend to have
gotten everyplace that could benefit, but it catches many of them.  I made
an effort in particular to ensure that all uses of the same error message
text were updated together, so as not to increase the number of
translatable strings.

It's possible that this change will result in format-string warnings from
pre-C99 compilers.  We might have to reconsider if there are any popular
compilers that will warn about this; but let's start by seeing what the
buildfarm thinks.

Andres Freund, with a little additional work by me
2014-01-23 17:18:33 -05:00
..
access Allow use of "z" flag in our printf calls, and use it where appropriate. 2014-01-23 17:18:33 -05:00
bootstrap Fix possible crashes due to using elog/ereport too early in startup. 2014-01-11 16:36:07 -05:00
catalog Make DROP IF EXISTS more consistently not fail 2014-01-23 14:40:29 -03:00
commands Make DROP IF EXISTS more consistently not fail 2014-01-23 14:40:29 -03:00
executor Make bitmap heap scans show exact/lossy block info in EXPLAIN ANALYZE. 2014-01-13 14:42:16 -05:00
foreign Update copyright for 2014 2014-01-07 16:05:30 -05:00
lib Update copyright for 2014 2014-01-07 16:05:30 -05:00
libpq Remove support for native krb5 authentication 2014-01-19 17:05:01 +01:00
main Fix possible crashes due to using elog/ereport too early in startup. 2014-01-11 16:36:07 -05:00
nodes Allow use of "z" flag in our printf calls, and use it where appropriate. 2014-01-23 17:18:33 -05:00
optimizer Speed up COPY into tables with DEFAULT nextval() 2014-01-20 17:22:38 +00:00
parser Make DROP IF EXISTS more consistently not fail 2014-01-23 14:40:29 -03:00
po
port Allow use of "z" flag in our printf calls, and use it where appropriate. 2014-01-23 17:18:33 -05:00
postmaster Fix VACUUM's reporting of dead-tuple counts to the stats collector. 2014-01-18 19:24:33 -05:00
regex Make various variables const (read-only). 2014-01-18 16:04:32 -05:00
replication Fix Hot Standby feedback sending when streaming busily. 2014-01-16 23:15:41 +02:00
rewrite Update copyright for 2014 2014-01-07 16:05:30 -05:00
snowball Update copyright for 2014 2014-01-07 16:05:30 -05:00
storage Allow use of "z" flag in our printf calls, and use it where appropriate. 2014-01-23 17:18:33 -05:00
tcop Add ALTER TABLESPACE ... MOVE command 2014-01-18 18:56:40 -05:00
tsearch Make various variables const (read-only). 2014-01-18 16:04:32 -05:00
utils Allow use of "z" flag in our printf calls, and use it where appropriate. 2014-01-23 17:18:33 -05:00
.gitignore
common.mk
Makefile Update copyright for 2014 2014-01-07 16:05:30 -05:00
nls.mk