summaryrefslogtreecommitdiff
path: root/src/include/c.h
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/c.h
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/c.h')
-rw-r--r--src/include/c.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/include/c.h b/src/include/c.h
index 37d360d941..372e548f8a 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)