diff options
author | Kaleb KEITHLEY <kkeithle@redhat.com> | 2012-01-25 07:01:48 -0500 |
---|---|---|
committer | Vijay Bellur <vijay@gluster.com> | 2012-01-26 02:10:33 -0800 |
commit | e8c722ba2832e4d0cae6ba3d043e5f06aaadbacd (patch) | |
tree | 3f8e175e746100c08917b7122939cb4a21a2c62c | |
parent | ef1f9cfbaeb62fbabfcc175dc643baa125b393bb (diff) |
Add format/printf/attribute to log decls
This enables compile-time checking of printf-style format checking
Reason for doing it this way: N/A
Description of test cases: N/A
Change-Id: I9e26a5dceef5b545b9434b1d418c3d1193b4ef9a
Signed-off-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Reviewed-on: http://review.gluster.com/2693
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amar@gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
-rw-r--r-- | libglusterfs/src/logging.h | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/libglusterfs/src/logging.h b/libglusterfs/src/logging.h index 01c45453534..cb23cb54f06 100644 --- a/libglusterfs/src/logging.h +++ b/libglusterfs/src/logging.h @@ -113,10 +113,14 @@ void gf_log_globals_init (void); int gf_log_init (const char *filename); void gf_log_cleanup (void); -int _gf_log (const char *domain, const char *file, const char *function, - int32_t line, gf_loglevel_t level, const char *fmt, ...); -int _gf_log_callingfn (const char *domain, const char *file, const char *function, - int32_t line, gf_loglevel_t level, const char *fmt, ...); +int _gf_log (const char *domain, const char *file, + const char *function, int32_t line, gf_loglevel_t level, + const char *fmt, ...) + __attribute__ ((__format__ (__printf__, 6, 7))); +int _gf_log_callingfn (const char *domain, const char *file, + const char *function, int32_t line, gf_loglevel_t level, + const char *fmt, ...) + __attribute__ ((__format__ (__printf__, 6, 7))); int _gf_log_nomem (const char *domain, const char *file, const char *function, int line, gf_loglevel_t level, @@ -143,7 +147,8 @@ void gf_log_set_xl_loglevel (void *xl, gf_loglevel_t level); #define GF_ERROR(xl, format, args...) \ gf_log ((xl)->name, GF_LOG_ERROR, format, ##args) -int gf_cmd_log (const char *domain, const char *fmt, ...); +int gf_cmd_log (const char *domain, const char *fmt, ...) + __attribute__ ((__format__ (__printf__, 2, 3))); int gf_cmd_log_init (const char *filename); |