summaryrefslogtreecommitdiff
path: root/src/port
diff options
context:
space:
mode:
authorTom Lane2018-09-26 17:13:57 +0000
committerTom Lane2018-09-26 17:13:57 +0000
commit96bf88d52711ad3a0a4cc2d1d9cb0e2acab85e63 (patch)
tree5fe0dd88e19f308167a9d17c19b372012573dd8e /src/port
parent758ce9b7794845f95473c569155d29fcf0e2751b (diff)
Always use our own versions of *printf().
We've spent an awful lot of effort over the years in coping with platform-specific vagaries of the *printf family of functions. Let's just forget all that mess and standardize on always using src/port/snprintf.c. This gets rid of a lot of configure logic, and it will allow a saner approach to dealing with %m (though actually changing that is left for a follow-on patch). Preliminary performance testing suggests that as it stands, snprintf.c is faster than the native printf functions for some tasks on some platforms, and slower for other cases. A pending patch will improve that, though cases with floating-point conversions will doubtless remain slower unless we want to put a *lot* of effort into that. Still, we've not observed that *printf is really a performance bottleneck for most workloads, so I doubt this matters much. Patch by me, reviewed by Michael Paquier Discussion: https://postgr.es/m/2975.1526862605@sss.pgh.pa.us
Diffstat (limited to 'src/port')
-rw-r--r--src/port/Makefile3
-rw-r--r--src/port/README2
2 files changed, 3 insertions, 2 deletions
diff --git a/src/port/Makefile b/src/port/Makefile
index b3a10ba014f..a2ee8e2d6d0 100644
--- a/src/port/Makefile
+++ b/src/port/Makefile
@@ -33,7 +33,8 @@ LIBS += $(PTHREAD_LIBS)
OBJS = $(LIBOBJS) $(PG_CRC32C_OBJS) chklocale.o erand48.o inet_net_ntop.o \
noblock.o path.o pgcheckdir.o pgmkdirp.o pgsleep.o \
pgstrcasecmp.o pqsignal.o \
- qsort.o qsort_arg.o quotes.o sprompt.o strerror.o tar.o thread.o
+ qsort.o qsort_arg.o quotes.o snprintf.o sprompt.o strerror.o \
+ tar.o thread.o
ifeq ($(enable_strong_random), yes)
OBJS += pg_strong_random.o
diff --git a/src/port/README b/src/port/README
index 4ae96da0158..c446b46e26e 100644
--- a/src/port/README
+++ b/src/port/README
@@ -18,7 +18,7 @@ and adding infrastructure to recompile the object files:
OBJS= execute.o typename.o descriptor.o data.o error.o prepare.o memory.o \
connect.o misc.o path.o exec.o \
- $(filter snprintf.o, $(LIBOBJS))
+ $(filter strlcat.o, $(LIBOBJS))
The problem is that there is no testing of which object files need to be
added, but missing functions usually show up when linking user