diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2001-10-03 21:58:28 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2001-10-03 21:58:28 +0000 |
commit | fcd2e372a77ae5186e80aee20844621139fdf33c (patch) | |
tree | d5c23e6be4890e4c053a95b62d23a4129dc39966 /src/interfaces/libpq/pqexpbuffer.h | |
parent | 2e5fda7b7e0613b4b7c69d69b609e639deac7c17 (diff) | |
download | postgresql-fcd2e372a77ae5186e80aee20844621139fdf33c.tar.gz |
Consistently use gcc's __attribute__((format)) to check sprintf-style
format strings wherever possible. Remarkably, this exercise didn't
turn up any inconsistencies, but it seems a good idea for the future.
Diffstat (limited to 'src/interfaces/libpq/pqexpbuffer.h')
-rw-r--r-- | src/interfaces/libpq/pqexpbuffer.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/interfaces/libpq/pqexpbuffer.h b/src/interfaces/libpq/pqexpbuffer.h index 7d5b07f730..0db0806595 100644 --- a/src/interfaces/libpq/pqexpbuffer.h +++ b/src/interfaces/libpq/pqexpbuffer.h @@ -18,7 +18,7 @@ * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: pqexpbuffer.h,v 1.6 2001/01/24 19:43:31 momjian Exp $ + * $Id: pqexpbuffer.h,v 1.7 2001/10/03 21:58:28 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -122,7 +122,9 @@ extern int enlargePQExpBuffer(PQExpBuffer str, size_t needed); * This is a convenience routine that does the same thing as * resetPQExpBuffer() followed by appendPQExpBuffer(). */ -extern void printfPQExpBuffer(PQExpBuffer str, const char *fmt,...); +extern void printfPQExpBuffer(PQExpBuffer str, const char *fmt, ...) +/* This extension allows gcc to check the format string */ +__attribute__((format(printf, 2, 3))); /*------------------------ * appendPQExpBuffer @@ -131,7 +133,9 @@ extern void printfPQExpBuffer(PQExpBuffer str, const char *fmt,...); * to str if necessary. This is sort of like a combination of sprintf and * strcat. */ -extern void appendPQExpBuffer(PQExpBuffer str, const char *fmt,...); +extern void appendPQExpBuffer(PQExpBuffer str, const char *fmt, ...) +/* This extension allows gcc to check the format string */ +__attribute__((format(printf, 2, 3))); /*------------------------ * appendPQExpBufferStr |