diff options
author | Anand Avati <avati@gluster.com> | 2011-01-04 14:00:28 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2011-01-06 11:09:11 -0800 |
commit | 879dc2f04f2bd35362bee214618f78ec4d688949 (patch) | |
tree | 149cf668b5f07ea5e61fe49fac628e58dd4e5c3d /libglusterfs/src | |
parent | cfc387b0af174dfe303cdb3ef3ccfba979ef75ac (diff) |
logging: reintroduce build warning for mismatching format strings and parameters
Signed-off-by: Anand V. Avati <avati@blackhole.gluster.com>
Signed-off-by: Amar Tumballi <amar@gluster.com>
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
BUG: 2211 ((re)introduce warnings for format string/parameter mismatch)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2211
Diffstat (limited to 'libglusterfs/src')
-rw-r--r-- | libglusterfs/src/logging.h | 6 |
1 files changed, 6 insertions, 0 deletions
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__, \ |