]> granicus.if.org Git - postgresql/commitdiff
Fix GCC 7 snprintf() compiler warning.
authorAndres Freund <andres@anarazel.de>
Tue, 3 Apr 2018 21:08:41 +0000 (14:08 -0700)
committerAndres Freund <andres@anarazel.de>
Tue, 3 Apr 2018 21:08:41 +0000 (14:08 -0700)
Make buffer 1 byte larger to fit a sign.  It's actually impossible for
there to be a sign in practice, but this is still required to keep GCC 7
happy.

Cleanup from commit 51bc271790eb234a1ba4d14d3e6530f70de92ab5.

Based on a suggestion from Peter Eisentraut.

Author: Peter Geoghegan
Reported-By: Peter Eisentraut
Discussion: https://postgr.es/m/d1cc82ed-d07d-cef2-7c00-2e987f121648@2ndquadrant.com

src/test/modules/test_bloomfilter/test_bloomfilter.c

index 1691b0fb30e9b9e5919564c4c4772ccb4e2a3116..358afbefa38fd0c9654ad07c223fd0676995acba 100644 (file)
@@ -18,8 +18,8 @@
 
 PG_MODULE_MAGIC;
 
-/* Must fit decimal representation of PG_INT64_MAX + 2 bytes: */
-#define MAX_ELEMENT_BYTES              20
+/* Fits decimal representation of PG_INT64_MIN + 2 bytes: */
+#define MAX_ELEMENT_BYTES              21
 /* False positive rate WARNING threshold (1%): */
 #define FPOSITIVE_THRESHOLD            0.01