px4_log: reverted unused attribute annotations

Used a do_nothing() function for px4_omit() that will satisfy the
compiler so it will not report unused variables when a debug
message is compiled out.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
This commit is contained in:
Mark Charlebois
2015-06-18 07:41:22 -07:00
parent 552c9800a9
commit 785053e4f1
4 changed files with 11 additions and 5 deletions
+7 -1
View File
@@ -58,6 +58,12 @@
__BEGIN_DECLS
__EXPORT extern uint64_t hrt_absolute_time(void);
// Used to silence unused variable warning
static inline void do_nothing(int level, ...)
{
(void)level;
}
#define _PX4_LOG_LEVEL_ALWAYS 0
#define _PX4_LOG_LEVEL_PANIC 1
#define _PX4_LOG_LEVEL_ERROR 2
@@ -103,7 +109,7 @@ __EXPORT extern int __px4_log_level_current;
* __px4_log_omit:
* Compile out the message
****************************************************************************/
#define __px4_log_omit(level, FMT, ...) { }
#define __px4_log_omit(level, FMT, ...) do_nothing(level, ##__VA_ARGS__)
/****************************************************************************
* __px4_log: