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 diff --git a/components/wear_levelling/CMakeLists.txt b/components/wear_levelling/CMakeLists.txt index e8b289dc116..2eee21d4d2c 100644 --- a/components/wear_levelling/CMakeLists.txt +++ b/components/wear_levelling/CMakeLists.txt @@ -11,7 +11,3 @@ idf_component_register(SRCS "Partition.cpp" PRIV_INCLUDE_DIRS private_include REQUIRES esp_partition esp_blockdev PRIV_REQUIRES spi_flash) - -if(CONFIG_COMPILER_STATIC_ANALYZER AND CMAKE_C_COMPILER_ID STREQUAL "GNU") # TODO IDF-10089 - target_compile_options(${COMPONENT_LIB} PUBLIC -fno-analyzer) -endif() diff --git a/components/wear_levelling/WL_Flash.cpp b/components/wear_levelling/WL_Flash.cpp index 92050daef9b..c64af17c9f3 100644 --- a/components/wear_levelling/WL_Flash.cpp +++ b/components/wear_levelling/WL_Flash.cpp @@ -40,6 +40,10 @@ WL_Flash::~WL_Flash() esp_err_t WL_Flash::config(wl_config_t *cfg, Flash_Access *partition) { + if (cfg == NULL || partition == NULL) { + return ESP_ERR_INVALID_ARG; + } + ESP_LOGV(TAG, "%s partition_start_addr=0x%08" PRIx32 ", wl_partition_size=0x%08" PRIx32 ", wl_page_size=0x%08" PRIx32 ", flash_sector_size=0x%08" PRIx32 ", wl_update_rate=0x%08" PRIx32 ", wl_pos_update_record_size=0x%08" PRIx32 ", version=0x%08" PRIx32 ", wl_temp_buff_size=0x%08" PRIx32 , __func__, (uint32_t) cfg->wl_partition_start_addr, cfg->wl_partition_size, @@ -57,13 +61,7 @@ esp_err_t WL_Flash::config(wl_config_t *cfg, Flash_Access *partition) this->cfg.wl_temp_buff_size = this->cfg.wl_pos_update_record_size; } this->configured = false; - if (cfg == NULL) { - result = ESP_ERR_INVALID_ARG; - } this->partition = partition; - if (partition == NULL) { - result = ESP_ERR_INVALID_ARG; - } if ((this->cfg.flash_sector_size % this->cfg.wl_temp_buff_size) != 0) { result = ESP_ERR_INVALID_ARG; }