mirror of
https://github.com/espressif/esp-idf.git
synced 2026-09-22 13:01:16 +03:00
Merge branch 'bugfix/nvs-flash-gnu-static-analyzer' into 'master'
fix(nvs_flash): fix GNU static analyzer warnings Closes IDF-10088 and IDF-10089 See merge request espressif/esp-idf!49122
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user