Elyes Haouas has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/84171?usp=email )
Change subject: commonlib/loglevel.h: Fix Wunterminated-string-initialization error ......................................................................
commonlib/loglevel.h: Fix Wunterminated-string-initialization error
This fixes following error: src/commonlib/include/commonlib/loglevel.h:170:26: error: initializer-string for array of 'char' is too long [-Werror=unterminated-string-initialization] 170 | [BIOS_EMERG] = "EMERG", | ^~~~~~~ src/commonlib/include/commonlib/loglevel.h:171:26: error: initializer-string for array of 'char' is too long [-Werror=unterminated-string-initialization] 171 | [BIOS_ALERT] = "ALERT", | ^~~~~~~ src/commonlib/include/commonlib/loglevel.h:172:26: error: initializer-string for array of 'char' is too long [-Werror=unterminated-string-initialization] 172 | [BIOS_CRIT] = "CRIT ", | ^~~~~~~ src/commonlib/include/commonlib/loglevel.h:173:26: error: initializer-string for array of 'char' is too long [-Werror=unterminated-string-initialization] 173 | [BIOS_ERR] = "ERROR", | ^~~~~~~ CC host/lib/cbfstool.o src/commonlib/include/commonlib/loglevel.h:174:26: error: initializer-string for array of 'char' is too long [-Werror=unterminated-string-initialization] 174 | [BIOS_WARNING] = "WARN ", | ^~~~~~~ src/commonlib/include/commonlib/loglevel.h:175:26: error: initializer-string for array of 'char' is too long [-Werror=unterminated-string-initialization] 175 | [BIOS_NOTICE] = "NOTE ", | ^~~~~~~ src/commonlib/include/commonlib/loglevel.h:176:26: error: initializer-string for array of 'char' is too long [-Werror=unterminated-string-initialization] 176 | [BIOS_INFO] = "INFO ", | ^~~~~~~ src/commonlib/include/commonlib/loglevel.h:177:26: error: initializer-string for array of 'char' is too long [-Werror=unterminated-string-initialization] 177 | [BIOS_DEBUG] = "DEBUG", | ^~~~~~~ src/commonlib/include/commonlib/loglevel.h:178:26: error: initializer-string for array of 'char' is too long [-Werror=unterminated-string-initialization] 178 | [BIOS_SPEW] = "SPEW ", | ^~~~~~~
Change-Id: I6b149239cf301aa00b2c1ee8ff811492590a07f9 Signed-off-by: Elyes Haouas ehaouas@noos.fr --- M src/commonlib/include/commonlib/loglevel.h 1 file changed, 1 insertion(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/71/84171/1
diff --git a/src/commonlib/include/commonlib/loglevel.h b/src/commonlib/include/commonlib/loglevel.h index 79fbcfc..19a9d9b 100644 --- a/src/commonlib/include/commonlib/loglevel.h +++ b/src/commonlib/include/commonlib/loglevel.h @@ -165,8 +165,7 @@ */ #define BIOS_LOG_PREFIX_PATTERN "[%.5s] " #define BIOS_LOG_PREFIX_MAX_LEVEL BIOS_SPEW -static const char bios_log_prefix[BIOS_LOG_PREFIX_MAX_LEVEL + 1][5] = { - /* Note: These strings are *not* null-terminated to save space. */ +static const char *bios_log_prefix[BIOS_LOG_PREFIX_MAX_LEVEL + 1] __attribute__((unused)) = { [BIOS_EMERG] = "EMERG", [BIOS_ALERT] = "ALERT", [BIOS_CRIT] = "CRIT ",