Fix compiler warnings about appendStringInfoVA and appendStringInfoVA_s.

gcc was correctly complaining that these functions should be
declared with the `printf` format attribute. Addresses Issue #14.
This commit is contained in:
Josh Kupershmidt 2012-10-18 20:32:18 -07:00
parent 6c8c532701
commit 0942141245
2 changed files with 6 additions and 1 deletions

View File

@ -149,7 +149,8 @@ extern void CHECK_FOR_INTERRUPTS(void);
#define appendStringInfoChar appendPQExpBufferChar
#define appendBinaryStringInfo appendBinaryPQExpBuffer
extern bool appendStringInfoVA(StringInfo str, const char *fmt, va_list args);
extern bool appendStringInfoVA(StringInfo str, const char *fmt, va_list args)
__attribute__((format(printf, 2, 0)));
extern int appendStringInfoFile(StringInfo str, FILE *fp);
extern int appendStringInfoFd(StringInfo str, int fd);

View File

@ -13,6 +13,10 @@
#define EXEC_FAILED(ret, expected) \
(((expected) > 0 && (ret) != (expected)) || (ret) < 0)
static void
appendStringInfoVA_s(StringInfo str, const char *fmt, va_list args)
__attribute__((format(printf, 2, 0)));
static void
termStringInfo(StringInfo str)
{