From 860420f04ff8f89b6057d9eb162be2b7497465f8 Mon Sep 17 00:00:00 2001 From: Liu Qing Date: Thu, 16 Dec 2021 14:15:07 +0800 Subject: [PATCH] log: fix out-of-order designated initializer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch will fix the following c++ warning, if SPDK_LOG_REGISTER_COMPONENT is used in c++ projects. designator order for field ‘spdk_log_flag::name’ does not match declaration order in ‘spdk_log_flag’ Signed-off-by: Liu Qing Change-Id: I2a709bc78d8e4329055c2cd83cddddae01fb0fa1 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10697 Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins Reviewed-by: Changpeng Liu Reviewed-by: Jim Harris --- include/spdk/log.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/spdk/log.h b/include/spdk/log.h index 68e5ab937..05acdd9a5 100644 --- a/include/spdk/log.h +++ b/include/spdk/log.h @@ -223,8 +223,8 @@ void spdk_log_register_flag(const char *name, struct spdk_log_flag *flag); #define SPDK_LOG_REGISTER_COMPONENT(FLAG) \ struct spdk_log_flag SPDK_LOG_##FLAG = { \ - .enabled = false, \ .name = #FLAG, \ + .enabled = false, \ }; \ __attribute__((constructor)) static void register_flag_##FLAG(void) \ { \