From 86e17791403defe2dc2c3dd16816c7ced159716f Mon Sep 17 00:00:00 2001 From: David Cermak Date: Thu, 3 Jun 2021 12:58:44 +0200 Subject: [PATCH 1/3] Build: Fix CMake to pass -Wwrite-string compiler flag if enabled --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3b3d6f74b0..d0adb9bb17 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -74,6 +74,10 @@ if(CONFIG_COMPILER_DISABLE_GCC8_WARNINGS) "-Wno-int-in-bool-context") endif() +if(CONFIG_COMPILER_WARN_WRITE_STRINGS) + list(APPEND compile_options "-Wwrite-strings") +endif() + if(CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_DISABLE) list(APPEND compile_definitions "-DNDEBUG") endif() From 02ac1baee4da92b097c8c0c25beb6463c6beee98 Mon Sep 17 00:00:00 2001 From: David Cermak Date: Fri, 4 Jun 2021 13:23:24 +0200 Subject: [PATCH 2/3] wpa_supplicant: Temporarily disable write-string warning Since some assignment of a string literal to `char *` variables were added and not caught by the CI. --- components/wpa_supplicant/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/wpa_supplicant/CMakeLists.txt b/components/wpa_supplicant/CMakeLists.txt index 3b35a84c8d..79503b7af0 100644 --- a/components/wpa_supplicant/CMakeLists.txt +++ b/components/wpa_supplicant/CMakeLists.txt @@ -157,7 +157,7 @@ idf_component_register(SRCS "${srcs}" "${tls_src}" "${roaming_src}" "${crypto_sr PRIV_INCLUDE_DIRS src src/utils PRIV_REQUIRES mbedtls esp_timer) -target_compile_options(${COMPONENT_LIB} PRIVATE -Wno-strict-aliasing) +target_compile_options(${COMPONENT_LIB} PRIVATE -Wno-strict-aliasing -Wno-write-strings) target_compile_definitions(${COMPONENT_LIB} PRIVATE __ets__ ESP_SUPPLICANT From 26f9d2d5e1aec6d4f0f7f72f911d377270a8c753 Mon Sep 17 00:00:00 2001 From: David Cermak Date: Fri, 4 Jun 2021 14:37:41 +0200 Subject: [PATCH 3/3] rtc: Fix minor const char* correction issue --- components/esp_hw_support/port/esp32s3/rtc_init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/esp_hw_support/port/esp32s3/rtc_init.c b/components/esp_hw_support/port/esp32s3/rtc_init.c index 2aa7a3fd0a..2b12794731 100644 --- a/components/esp_hw_support/port/esp32s3/rtc_init.c +++ b/components/esp_hw_support/port/esp32s3/rtc_init.c @@ -27,7 +27,7 @@ #define RTC_CNTL_MEM_FORCE_NOISO (RTC_CNTL_SLOWMEM_FORCE_NOISO | RTC_CNTL_FASTMEM_FORCE_NOISO) -static char *TAG = "rtcinit"; +static const char *TAG = "rtcinit"; void rtc_init(rtc_config_t cfg) {