[PATCH 16/21] lib/log: ensure code structure does not change

Andre Muezerie andremue at linux.microsoft.com
Wed Dec 11 03:05:46 CET 2024


Add "do { } while (0)" to macros used to remove logging calls, to
ensure there's no code structure change when enabling/disabling
logging.

Signed-off-by: Andre Muezerie <andremue at linux.microsoft.com>
---
 lib/log/rte_log.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/log/rte_log.h b/lib/log/rte_log.h
index 3735137150..6b00caab88 100644
--- a/lib/log/rte_log.h
+++ b/lib/log/rte_log.h
@@ -364,7 +364,7 @@ int rte_vlog(uint32_t level, uint32_t logtype, const char *format, va_list ap)
 	static_assert(!__builtin_strchr(fmt, '\n'), \
 		"This log format string contains a \\n")
 #else
-#define RTE_LOG_CHECK_NO_NEWLINE(...)
+#define RTE_LOG_CHECK_NO_NEWLINE(...) do { } while (0)
 #endif
 
 /**
-- 
2.47.0.vfs.0.3



More information about the dev mailing list