summaryrefslogtreecommitdiff
path: root/src/include/postgres.h
diff options
context:
space:
mode:
authorTom Lane2001-10-03 21:58:28 +0000
committerTom Lane2001-10-03 21:58:28 +0000
commitf710ebb6a3b2f54f6df39cdf33239d06133a243b (patch)
tree7ff07db38d468c7d0527993c9d04add8b9bc44e6 /src/include/postgres.h
parentbb35e9fcdaa83ecd497ed00cf4be216dbcacc88a (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/postgres.h')
-rw-r--r--src/include/postgres.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/include/postgres.h b/src/include/postgres.h
index 6688504246..d15fbb5fe9 100644
--- a/src/include/postgres.h
+++ b/src/include/postgres.h
@@ -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)