aboutsummaryrefslogtreecommitdiff
path: root/src/pl/plpython/plpython.c
diff options
context:
space:
mode:
authorAndrew Dunstan <andrew@dunslane.net>2011-04-28 10:56:14 -0400
committerAndrew Dunstan <andrew@dunslane.net>2011-04-28 10:56:14 -0400
commitc02d5b7c27d740830379244db4b9ef111bbf0fc8 (patch)
treef1de6c2b7db8181b7d703fc5bd6732ffecda3c8c /src/pl/plpython/plpython.c
parent39850c7fdb82bd7c64dbb759c5754e29fc0af5f2 (diff)
downloadpostgresql-c02d5b7c27d740830379244db4b9ef111bbf0fc8.tar.gz
postgresql-c02d5b7c27d740830379244db4b9ef111bbf0fc8.zip
Use a macro variable PG_PRINTF_ATTRIBUTE for the style used for checking printf type functions.
The style is set to "printf" for backwards compatibility everywhere except on Windows, where it is set to "gnu_printf", which eliminates hundreds of false error messages from modern versions of gcc arising from %m and %ll{d,u} formats.
Diffstat (limited to 'src/pl/plpython/plpython.c')
-rw-r--r--src/pl/plpython/plpython.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/pl/plpython/plpython.c b/src/pl/plpython/plpython.c
index 8108cfce2c0..fe44a1a16a0 100644
--- a/src/pl/plpython/plpython.c
+++ b/src/pl/plpython/plpython.c
@@ -324,14 +324,14 @@ static void PLy_init_plpy(void);
/* call PyErr_SetString with a vprint interface and translation support */
static void
PLy_exception_set(PyObject *, const char *,...)
-__attribute__((format(printf, 2, 3)));
+__attribute__((format(PG_PRINTF_ATTRIBUTE, 2, 3)));
/* same, with pluralized message */
static void
PLy_exception_set_plural(PyObject *, const char *, const char *,
unsigned long n,...)
-__attribute__((format(printf, 2, 5)))
-__attribute__((format(printf, 3, 5)));
+__attribute__((format(PG_PRINTF_ATTRIBUTE, 2, 5)))
+__attribute__((format(PG_PRINTF_ATTRIBUTE, 3, 5)));
/* like PLy_exception_set, but conserve more fields from ErrorData */
static void PLy_spi_exception_set(PyObject *excclass, ErrorData *edata);
@@ -342,7 +342,7 @@ static char *PLy_procedure_name(PLyProcedure *);
/* some utility functions */
static void
PLy_elog(int, const char *,...)
-__attribute__((format(printf, 2, 3)));
+__attribute__((format(PG_PRINTF_ATTRIBUTE, 2, 3)));
static void PLy_get_spi_error_data(PyObject *exc, char **detail, char **hint, char **query, int *position);
static void PLy_traceback(char **, char **, int *);