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/include/postgres.h | |
parent | 2e5fda7b7e0613b4b7c69d69b609e639deac7c17 (diff) | |
download | postgresql-fcd2e372a77ae5186e80aee20844621139fdf33c.tar.gz postgresql-fcd2e372a77ae5186e80aee20844621139fdf33c.zip |
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.h | 7 |
1 files changed, 5 insertions, 2 deletions
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) |