summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
Diffstat (limited to 'src/include')
-rw-r--r--src/include/c.h8
-rw-r--r--src/include/lib/stringinfo.h6
-rw-r--r--src/include/postgres.h7
3 files changed, 13 insertions, 8 deletions
diff --git a/src/include/c.h b/src/include/c.h
index 37d360d941b..372e548f8af 100644
--- a/src/include/c.h
+++ b/src/include/c.h
@@ -12,7 +12,7 @@
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: c.h,v 1.101 2001/08/27 23:02:25 tgl Exp $
+ * $Id: c.h,v 1.102 2001/10/03 21:58:28 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -634,13 +634,13 @@ typedef NameData *Name;
*/
#ifndef HAVE_SNPRINTF_DECL
-extern int snprintf(char *str, size_t count, const char *fmt,...);
-
+extern int snprintf(char *str, size_t count, const char *fmt, ...)
+/* This extension allows gcc to check the format string */
+__attribute__((format(printf, 3, 4)));
#endif
#ifndef HAVE_VSNPRINTF_DECL
extern int vsnprintf(char *str, size_t count, const char *fmt, va_list args);
-
#endif
#if !defined(HAVE_MEMMOVE) && !defined(memmove)
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
diff --git a/src/include/postgres.h b/src/include/postgres.h
index 964f1eaef1f..3ae7bc44f81 100644
--- a/src/include/postgres.h
+++ b/src/include/postgres.h
@@ -10,7 +10,7 @@
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1995, Regents of the University of California
*
- * $Id: postgres.h,v 1.52 2001/08/24 22:46:28 petere Exp $
+ * $Id: postgres.h,v 1.53 2001/10/03 21:58:28 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -562,7 +562,10 @@ extern DLLIMPORT bool assert_enabled;
extern int ExceptionalCondition(char *conditionName,
Exception *exceptionP, char *details,
char *fileName, int lineNumber);
-extern char *vararg_format(const char *fmt,...);
+
+extern char *vararg_format(const char *fmt, ...)
+/* This lets gcc check the format string for consistency. */
+__attribute__((format(printf, 1, 2)));
#ifndef USE_ASSERT_CHECKING
#define LogAssert(condition, printArgs)