diff options
author | Jeremy Sowden <jeremy@azazel.net> | 2021-11-21 20:41:35 +0000 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2021-11-23 14:24:53 +0100 |
commit | 2bbccbe70eec3a0503bee6cde76d8349fd8f675e (patch) | |
tree | 1506fc60a0b24c466f6ade84ad753e5941568438 /include/ulogd/ulogd.h | |
parent | 25b348fa0c482619a39fa89cd423f2cbb47d5dc1 (diff) |
include: add `format` attribute to `__ulogd_log` declaration
`__ulogd_log` takes a printf-style format string and matching arguments.
Add the gcc `format` attribute to its declaration in order to allow the
compiler to type-check the function arguments against the specifiers in
the format string.
Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'include/ulogd/ulogd.h')
-rw-r--r-- | include/ulogd/ulogd.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/include/ulogd/ulogd.h b/include/ulogd/ulogd.h index 1636a8c..a487c8e 100644 --- a/include/ulogd/ulogd.h +++ b/include/ulogd/ulogd.h @@ -299,8 +299,9 @@ void ulogd_register_plugin(struct ulogd_plugin *me); /* allocate a new ulogd_key */ struct ulogd_key *alloc_ret(const uint16_t type, const char*); -/* write a message to the daemons' logfile */ -void __ulogd_log(int level, char *file, int line, const char *message, ...); +/* write a message to the daemon's logfile */ +void __ulogd_log(int level, char *file, int line, const char *message, ...) + __attribute__((format(printf, 4, 5))); /* macro for logging including filename and line number */ #define ulogd_log(level, format, args...) \ __ulogd_log(level, __FILE__, __LINE__, format, ## args) |