mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-18 16:43:34 +08:00
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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user