summaryrefslogtreecommitdiff
path: root/src/include/lib
diff options
context:
space:
mode:
authorTom Lane2001-10-03 21:58:28 +0000
committerTom Lane2001-10-03 21:58:28 +0000
commitfcd2e372a77ae5186e80aee20844621139fdf33c (patch)
treed5c23e6be4890e4c053a95b62d23a4129dc39966 /src/include/lib
parent2e5fda7b7e0613b4b7c69d69b609e639deac7c17 (diff)
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/include/lib')
-rw-r--r--src/include/lib/stringinfo.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/include/lib/stringinfo.h b/src/include/lib/stringinfo.h
index 2ddff7053c2..6f1406ff161 100644
--- a/src/include/lib/stringinfo.h
+++ b/src/include/lib/stringinfo.h
@@ -10,7 +10,7 @@
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: stringinfo.h,v 1.19 2001/01/24 19:43:24 momjian Exp $
+ * $Id: stringinfo.h,v 1.20 2001/10/03 21:58:28 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -81,7 +81,9 @@ extern void initStringInfo(StringInfo str);
* to str if necessary. This is sort of like a combination of sprintf and
* strcat.
*/
-extern void appendStringInfo(StringInfo str, const char *fmt,...);
+extern void appendStringInfo(StringInfo str, const char *fmt, ...)
+/* This extension allows gcc to check the format string */
+__attribute__((format(printf, 2, 3)));
/*------------------------
* appendStringInfoChar