From cb67d586a451fd77f862b1462e8b778c43169a23 Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Tue, 10 Jan 2017 14:21:02 +0100 Subject: [PATCH] add format indicator to get LOG_X warnings The LOG_X macros emit a lot of warnings when compiling with the T because they call the function logRecord (or logRecord_mt) which has not been "marked" as calling printf, so gcc won't emit typical printf warnings. With the T, they directly translate to sprintf, so those warnings pop up, much more verbose due to several macro expansions. Let's make them pop up all the time so it's easier to fix them. --- openair2/UTIL/LOG/log_if.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openair2/UTIL/LOG/log_if.h b/openair2/UTIL/LOG/log_if.h index 1b447a7f60..3dd25ff365 100644 --- a/openair2/UTIL/LOG/log_if.h +++ b/openair2/UTIL/LOG/log_if.h @@ -60,8 +60,8 @@ extern "C" { //public_log_if( log_t *g_log;) public_log_if( int logInit (void);) -public_log_if( void logRecord_mt(const char *file, const char *func, int line,int comp, int level, const char *format, ...);) -public_log_if( void logRecord(const char *file, const char *func, int line,int comp, int level, const char *format, ...);) +public_log_if( void logRecord_mt(const char *file, const char *func, int line,int comp, int level, const char *format, ...) __attribute__ ((format (printf, 6, 7)));) +public_log_if( void logRecord(const char *file, const char *func, int line,int comp, int level, const char *format, ...) __attribute__ ((format (printf, 6, 7)));) public_log_if( int set_comp_log(int component, int level, int verbosity, int interval);) public_log_if( int set_log(int component, int level, int interval);) public_log_if( void set_glog(int level, int verbosity);) -- GitLab