diff options
author | Lennart Poettering <lennart@poettering.net> | 2007-06-11 15:42:31 +0000 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2007-06-11 15:42:31 +0000 |
commit | 5be2d89dfdfef9e7fb8eb349404cba75cd494933 (patch) | |
tree | f0bbfc7f03a21c7b71aa2652dd2d7b5592d00b0b | |
parent | 291e39e6180ca6ec3942ddeb3f79fa3439d5cb55 (diff) |
make use of gcc sentinel attribute
git-svn-id: file:///home/lennart/svn/public/libdaemon/trunk@119 153bfa13-eec0-0310-be40-b0cb6a0e1b4b
-rw-r--r-- | libdaemon/dexec.h | 9 |
1 files changed, 8 insertions, 1 deletions
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 |