turn on printf warnings for all the printf-like atf functions.

This commit is contained in:
christos 2011-06-11 18:03:57 +00:00
parent 2a18cea9f4
commit 7267577190
3 changed files with 29 additions and 14 deletions

View File

@ -31,5 +31,6 @@
#define ATF_C_DEFS_H
#define ATF_DEFS_ATTRIBUTE_NORETURN @ATTRIBUTE_NORETURN@
#define ATF_DEFS_ATTRIBUTE_PRINTF(a,b) @ATTRIBUTE_PRINTF(a,b)@
#endif /* !defined(ATF_C_DEFS_H) */

View File

@ -103,22 +103,35 @@ atf_error_t atf_tc_run(const atf_tc_t *, const char *);
atf_error_t atf_tc_cleanup(const atf_tc_t *);
/* To be run from test case bodies only. */
void atf_tc_fail(const char *, ...) ATF_DEFS_ATTRIBUTE_NORETURN;
void atf_tc_fail_nonfatal(const char *, ...);
void atf_tc_pass(void) ATF_DEFS_ATTRIBUTE_NORETURN;
void atf_tc_fail(const char *, ...)
ATF_DEFS_ATTRIBUTE_PRINTF(1, 2)
ATF_DEFS_ATTRIBUTE_NORETURN;
void atf_tc_fail_nonfatal(const char *, ...)
ATF_DEFS_ATTRIBUTE_PRINTF(1, 2);
void atf_tc_pass(void)
ATF_DEFS_ATTRIBUTE_NORETURN;
void atf_tc_require_prog(const char *);
void atf_tc_skip(const char *, ...) ATF_DEFS_ATTRIBUTE_NORETURN;
void atf_tc_skip(const char *, ...)
ATF_DEFS_ATTRIBUTE_PRINTF(1, 2)
ATF_DEFS_ATTRIBUTE_NORETURN;
void atf_tc_expect_pass(void);
void atf_tc_expect_fail(const char *, ...);
void atf_tc_expect_exit(const int, const char *, ...);
void atf_tc_expect_signal(const int, const char *, ...);
void atf_tc_expect_death(const char *, ...);
void atf_tc_expect_timeout(const char *, ...);
void atf_tc_expect_fail(const char *, ...)
ATF_DEFS_ATTRIBUTE_PRINTF(1, 2);
void atf_tc_expect_exit(const int, const char *, ...)
ATF_DEFS_ATTRIBUTE_PRINTF(2, 3);
void atf_tc_expect_signal(const int, const char *, ...)
ATF_DEFS_ATTRIBUTE_PRINTF(2, 3);
void atf_tc_expect_death(const char *, ...)
ATF_DEFS_ATTRIBUTE_PRINTF(1, 2);
void atf_tc_expect_timeout(const char *, ...)
ATF_DEFS_ATTRIBUTE_PRINTF(1, 2);
/* To be run from test case bodies only; internal to macros.h. */
void atf_tc_fail_check(const char *, const size_t, const char *, ...);
void atf_tc_fail_check(const char *, const size_t, const char *, ...)
ATF_DEFS_ATTRIBUTE_PRINTF(3, 4);
void atf_tc_fail_requirement(const char *, const size_t, const char *, ...)
ATF_DEFS_ATTRIBUTE_NORETURN;
ATF_DEFS_ATTRIBUTE_PRINTF(3, 4)
ATF_DEFS_ATTRIBUTE_NORETURN;
void atf_tc_check_errno(const char *, const size_t, const int,
const char *, const bool);
void atf_tc_require_errno(const char *, const size_t, const int,

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.10 2011/03/31 16:45:44 jmmv Exp $
# $NetBSD: Makefile,v 1.11 2011/06/11 18:03:57 christos Exp $
NOLINT= # defined
@ -75,8 +75,9 @@ MAN= atf-c-api.3
CLEANFILES+= defs.h
defs.h: defs.h.in
${TOOL_SED} -e \
's,@ATTRIBUTE_NORETURN@,__attribute__((__noreturn__)),g' \
${TOOL_SED} \
-e 's|@ATTRIBUTE_NORETURN@|__attribute__((__noreturn__))|g' \
-e 's|@ATTRIBUTE_PRINTF(a,b)@|__attribute__((__format__(__printf__,a,b)))|g' \
< ${.ALLSRC} > ${.TARGET}.tmp
mv ${.TARGET}.tmp ${.TARGET}