From: Alan Jenkins Date: Mon, 29 Sep 2008 16:50:21 +0000 (+0100) Subject: allow compiler to check dbg() arguments on non-debug builds X-Git-Tag: 174~1512 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=9176ac1f4e42f71df692773651898100b253774c allow compiler to check dbg() arguments on non-debug builds Signed-off-by: Alan Jenkins --- diff --git a/udev/lib/libudev-private.h b/udev/lib/libudev-private.h index 162b33aef..8f847158b 100644 --- a/udev/lib/libudev-private.h +++ b/udev/lib/libudev-private.h @@ -23,12 +23,17 @@ #include #include "libudev.h" +static inline void __attribute__ ((format(printf, 2, 3))) +log_null(struct udev *udev, const char *format, ...) +{ +} + #ifdef USE_LOG #ifdef USE_DEBUG #define dbg(udev, arg...) \ udev_log(udev, LOG_DEBUG, __FILE__, __LINE__, __FUNCTION__, ## arg) #else -#define dbg(format, arg...) do { } while (0) +#define dbg log_null #endif /* USE_DEBUG */ #define info(udev, arg...) \ @@ -37,9 +42,9 @@ #define err(udev, arg...) \ udev_log(udev, LOG_ERR, __FILE__, __LINE__, __FUNCTION__, ## arg) #else -#define dbg(format, arg...) do { } while (0) -#define info(format, arg...) do { } while (0) -#define err(format, arg...) do { } while (0) +#define dbg log_null +#define info log_null +#define err log_null #endif /* libudev */