From 07851651952eed86b8221d24756aefb5938e52c5 Mon Sep 17 00:00:00 2001 From: "sonika.rathi" Date: Tue, 2 Jun 2026 09:53:10 +0200 Subject: [PATCH] fix(nvs_flash): narrow GNU analyzer suppression to nvs_cxx_api --- components/nvs_flash/CMakeLists.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/components/nvs_flash/CMakeLists.txt b/components/nvs_flash/CMakeLists.txt index 70aad776d9f..d3abf208a19 100644 --- a/components/nvs_flash/CMakeLists.txt +++ b/components/nvs_flash/CMakeLists.txt @@ -91,8 +91,12 @@ else() target_link_libraries(${COMPONENT_LIB} PRIVATE idf::mbedtls) endif() - if(CONFIG_COMPILER_STATIC_ANALYZER AND CMAKE_C_COMPILER_ID STREQUAL "GNU") # TODO IDF-10088 - target_compile_options(${COMPONENT_LIB} PUBLIC "-fno-analyzer") + if(CONFIG_COMPILER_STATIC_ANALYZER AND CMAKE_C_COMPILER_ID STREQUAL "GNU") + # GCC fanalyzer false-positive on std::unique_ptr return path in nvs_cxx_api.cpp (TODO GCC-366) + set_source_files_properties( + src/nvs_cxx_api.cpp + PROPERTIES COMPILE_OPTIONS + "-Wno-error=analyzer-use-of-uninitialized-value;-Wno-analyzer-use-of-uninitialized-value") endif() endif() #non-OS build