From 879dc2f04f2bd35362bee214618f78ec4d688949 Mon Sep 17 00:00:00 2001 From: Anand Avati Date: Tue, 4 Jan 2011 14:00:28 +0000 Subject: logging: reintroduce build warning for mismatching format strings and parameters Signed-off-by: Anand V. Avati Signed-off-by: Amar Tumballi Signed-off-by: Anand V. Avati BUG: 2211 ((re)introduce warnings for format string/parameter mismatch) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2211 --- libglusterfs/src/logging.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libglusterfs/src/logging.h b/libglusterfs/src/logging.h index 39fdff1551b..235410e4999 100644 --- a/libglusterfs/src/logging.h +++ b/libglusterfs/src/logging.h @@ -75,7 +75,11 @@ typedef enum { extern gf_loglevel_t gf_log_loglevel; extern char gf_log_xl_log_set; +#define FMT_WARN(fmt...) do { if (0) printf (fmt); } while (0) + #define gf_log(dom, levl, fmt...) do { \ + FMT_WARN (fmt); \ + \ if ((levl > gf_log_loglevel) && !gf_log_xl_log_set) \ break; \ _gf_log (dom, __FILE__, __FUNCTION__, __LINE__, \ @@ -83,6 +87,8 @@ extern char gf_log_xl_log_set; } while (0) #define gf_log_callingfn(dom, levl, fmt...) do { \ + FMT_WARN (fmt); \ + \ if ((levl > gf_log_loglevel) && !gf_log_xl_log_set) \ break; \ _gf_log_callingfn (dom, __FILE__, __FUNCTION__, __LINE__, \ -- cgit