postgresql/src
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
..
backend Allow use of "z" flag in our printf calls, and use it where appropriate. 2014-01-23 17:18:33 -05:00
bin Add libpq function PQhostaddr(). 2014-01-24 02:32:39 +09:00
common Make various variables const (read-only). 2014-01-18 16:04:32 -05:00
include Allow use of "z" flag in our printf calls, and use it where appropriate. 2014-01-23 17:18:33 -05:00
interfaces Add libpq function PQhostaddr(). 2014-01-24 02:32:39 +09:00
makefiles Remove leftovers of IRIX port 2013-11-12 06:39:36 -05:00
pl Make DROP IF EXISTS more consistently not fail 2014-01-23 14:40:29 -03:00
port Allow use of "z" flag in our printf calls, and use it where appropriate. 2014-01-23 17:18:33 -05:00
template Remove leftovers of IRIX port 2013-11-12 06:39:36 -05:00
test Make DROP IF EXISTS more consistently not fail 2014-01-23 14:40:29 -03:00
timezone Update copyright for 2014 2014-01-07 16:05:30 -05:00
tools Allow case insensitive build version argument for MSVC. 2014-01-23 12:18:15 -05:00
tutorial Update copyright for 2014 2014-01-07 16:05:30 -05:00
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:04 +02:00
DEVELOPERS Replace a couple of references to files that no longer exist in the source 2009-05-04 08:08:47 +00:00
Makefile Create libpgcommon, and move pg_malloc et al to it 2013-02-12 11:21:05 -03:00
Makefile.global.in build: pass EXTRA_REGRESS_OPTS to secondary regression tests 2013-12-04 10:14:45 -05:00
Makefile.shlib Remove IRIX port. 2013-10-18 08:14:21 -04:00
bcc32.mak Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
nls-global.mk Remove maintainer-check target, fold into normal build 2013-10-10 20:11:56 -04:00
win32.mak Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00