diff options
| author | Andrew Dunstan <andrew@dunslane.net> | 2011-04-28 10:56:14 -0400 |
|---|---|---|
| committer | Andrew Dunstan <andrew@dunslane.net> | 2011-04-28 10:56:14 -0400 |
| commit | c02d5b7c27d740830379244db4b9ef111bbf0fc8 (patch) | |
| tree | f1de6c2b7db8181b7d703fc5bd6732ffecda3c8c /src/interfaces | |
| parent | 39850c7fdb82bd7c64dbb759c5754e29fc0af5f2 (diff) | |
| download | postgresql-c02d5b7c27d740830379244db4b9ef111bbf0fc8.tar.gz | |
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/interfaces')
| -rw-r--r-- | src/interfaces/ecpg/preproc/extern.h | 2 | ||||
| -rw-r--r-- | src/interfaces/libpq/libpq-int.h | 2 | ||||
| -rw-r--r-- | src/interfaces/libpq/pqexpbuffer.h | 4 |
3 files changed, 4 insertions, 4 deletions
diff --git a/src/interfaces/ecpg/preproc/extern.h b/src/interfaces/ecpg/preproc/extern.h index 05b273cc24..ccf5548f57 100644 --- a/src/interfaces/ecpg/preproc/extern.h +++ b/src/interfaces/ecpg/preproc/extern.h @@ -76,7 +76,7 @@ extern char *mm_strdup(const char *); extern void mmerror(int, enum errortype, const char *,...) /* This extension allows gcc to check the format string */ -__attribute__((format(printf, 3, 4))); +__attribute__((format(PG_PRINTF_ATTRIBUTE, 3, 4))); extern void output_get_descr_header(char *); extern void output_get_descr(char *, char *); extern void output_set_descr_header(char *); diff --git a/src/interfaces/libpq/libpq-int.h b/src/interfaces/libpq/libpq-int.h index fbd94ebfb8..d56ef5d489 100644 --- a/src/interfaces/libpq/libpq-int.h +++ b/src/interfaces/libpq/libpq-int.h @@ -505,7 +505,7 @@ extern PGresult *pqPrepareAsyncResult(PGconn *conn); extern void pqInternalNotice(const PGNoticeHooks *hooks, const char *fmt,...) /* This lets gcc check the format string for consistency. */ -__attribute__((format(printf, 2, 3))); +__attribute__((format(PG_PRINTF_ATTRIBUTE, 2, 3))); extern int pqAddTuple(PGresult *res, PGresAttValue *tup); extern void pqSaveMessageField(PGresult *res, char code, const char *value); diff --git a/src/interfaces/libpq/pqexpbuffer.h b/src/interfaces/libpq/pqexpbuffer.h index be7cc61d1c..d60fedc762 100644 --- a/src/interfaces/libpq/pqexpbuffer.h +++ b/src/interfaces/libpq/pqexpbuffer.h @@ -141,7 +141,7 @@ extern int enlargePQExpBuffer(PQExpBuffer str, size_t needed); extern void printfPQExpBuffer(PQExpBuffer str, const char *fmt,...) /* This extension allows gcc to check the format string */ -__attribute__((format(printf, 2, 3))); +__attribute__((format(PG_PRINTF_ATTRIBUTE, 2, 3))); /*------------------------ * appendPQExpBuffer @@ -153,7 +153,7 @@ __attribute__((format(printf, 2, 3))); extern void appendPQExpBuffer(PQExpBuffer str, const char *fmt,...) /* This extension allows gcc to check the format string */ -__attribute__((format(printf, 2, 3))); +__attribute__((format(PG_PRINTF_ATTRIBUTE, 2, 3))); /*------------------------ * appendPQExpBufferStr |
