From 5be2d89dfdfef9e7fb8eb349404cba75cd494933 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Mon, 11 Jun 2007 15:42:31 +0000 Subject: make use of gcc sentinel attribute git-svn-id: file:///home/lennart/svn/public/libdaemon/trunk@119 153bfa13-eec0-0310-be40-b0cb6a0e1b4b --- libdaemon/dexec.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/libdaemon/dexec.h b/libdaemon/dexec.h index 27b5ba1..ebfbee5 100644 --- a/libdaemon/dexec.h +++ b/libdaemon/dexec.h @@ -37,6 +37,13 @@ extern "C" { /** This variable is defined to 1 iff daemon_exec() is supported.*/ #define DAEMON_EXEC_AVAILABLE 1 +#if defined(__GNUC__) && ! defined(DAEMON_GCC_SENTINEL) +/** A macro for making use of GCCs printf compilation warnings */ +#define DAEMON_GCC_SENTINEL __attribute__ ((sentinel)) +#else +#define DAEMON_GCC_SENTINEL +#endif + /** Run the specified executable with the specified arguments in the * specified directory and return the return value of the program in * the specified pointer. The calling process is blocked until the @@ -50,7 +57,7 @@ extern "C" { * @param ... The arguments to be passed to the program, followed by a (char *) NULL * @return Nonzero on failure, zero on success */ -int daemon_exec(const char *dir, int *ret, const char *prog, ...); +int daemon_exec(const char *dir, int *ret, const char *prog, ...) DAEMON_GCC_SENTINEL; /** This variable is defined to 1 iff daemon_execv() is supported.*/ #define DAEMON_EXECV_AVAILABLE 1 -- cgit