From 5e824e6eb7f9b6381d3245f4ff51ad6edcb9ad0b Mon Sep 17 00:00:00 2001 From: Guillaume Souchere Date: Wed, 22 Apr 2026 14:45:16 +0200 Subject: [PATCH] fix(log): increase s_lvl_color array size to avoid GCC 15 truncation warning The ANSI color strings initializing s_lvl_color (e.g. "\033[0;31m\0") are 9 bytes, but the array second dimension was declared as [8], causing the implicit NUL terminator to be truncated. GCC 15 introduced -Wunterminated-string-initialization to flag this, resulting in a build error (-Werror) on the linux target which uses the host system GCC. Increase the dimension from [8] to [9] to accommodate the full string. Fixes https://github.com/espressif/esp-idf/issues/18500 --- components/log/src/log_format_text.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/log/src/log_format_text.c b/components/log/src/log_format_text.c index b1f7819970c..21172f1f9f0 100644 --- a/components/log/src/log_format_text.c +++ b/components/log/src/log_format_text.c @@ -28,7 +28,7 @@ static __attribute__((unused)) const char s_lvl_name[ESP_LOG_MAX] = { 'V', // VERBOSE }; -static __attribute__((unused)) const char s_lvl_color[ESP_LOG_MAX][8] = { +static __attribute__((unused)) const char s_lvl_color[ESP_LOG_MAX][9] = { "\0", // NONE LOG_ANSI_COLOR_REGULAR(LOG_ANSI_COLOR_RED)"\0", // ERROR LOG_ANSI_COLOR_REGULAR(LOG_ANSI_COLOR_YELLOW)"\0", // WARNING