From 719f68e7454d7eece45d1578911e7fa34d278e25 Mon Sep 17 00:00:00 2001 From: Ken Raeburn Date: Mon, 26 Jun 2000 20:57:51 +0000 Subject: [PATCH] * dbtest.c (err): Add format attribute to decl, for typechecking under GNU C git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@12433 dc483132-0cff-0310-8789-dd5450dbe970 --- src/util/db2/test/ChangeLog | 5 +++++ src/util/db2/test/dbtest.c | 8 +++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/util/db2/test/ChangeLog b/src/util/db2/test/ChangeLog index 4e147d746..7577da40f 100644 --- a/src/util/db2/test/ChangeLog +++ b/src/util/db2/test/ChangeLog @@ -1,3 +1,8 @@ +2000-06-26 Ken Raeburn + + * dbtest.c (err): Add format attribute to decl, for typechecking + under GNU C. + 1998-05-06 Theodore Ts'o * dbtest.c (main): POSIX states that getopt returns -1 diff --git a/src/util/db2/test/dbtest.c b/src/util/db2/test/dbtest.c index f499047ae..c3f24f02f 100644 --- a/src/util/db2/test/dbtest.c +++ b/src/util/db2/test/dbtest.c @@ -57,10 +57,16 @@ static char sccsid[] = "@(#)dbtest.c 8.17 (Berkeley) 9/1/94"; enum S { COMMAND, COMPARE, GET, PUT, REMOVE, SEQ, SEQFLAG, KEY, DATA }; +#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7) +#define ATTR(x) __attribute__(x) +#else +#define ATTR(x) +#endif + void compare __P((DBT *, DBT *)); DBTYPE dbtype __P((char *)); void dump __P((DB *, int)); -void err __P((const char *, ...)); +void err __P((const char *, ...)) ATTR ((__format__(__printf__,1,2))); void get __P((DB *, DBT *)); void getdata __P((DB *, DBT *, DBT *)); void put __P((DB *, DBT *, DBT *)); -- 2.26.2