change(ci): enable -Werror=unused-but-set-variable

This commit is contained in:
Alexey Lapshin
2026-07-16 10:54:36 +07:00
parent bf4218a71f
commit 1791325998
27 changed files with 117 additions and 51 deletions
+2 -1
View File
@@ -20,6 +20,7 @@
#include "osi/allocator.h"
#include "osi/config.h"
#include "osi/list.h"
#include "osi/osi.h"
#define CONFIG_FILE_MAX_SIZE (1536)//1.5k
#define CONFIG_FILE_DEFAULE_LENGTH (2048)
@@ -612,7 +613,7 @@ static bool config_parse(nvs_handle_t fp, config_t *config)
assert(config != NULL);
esp_err_t err;
int line_num = 0;
UNUSED_ATTR int line_num = 0;
int err_code = 0;
uint16_t i = 0;
size_t length = CONFIG_FILE_DEFAULE_LENGTH;
@@ -2358,6 +2358,8 @@ UINT16 L2CA_FlushChannel (UINT16 lcid, UINT16 num_to_flush)
num_flushed1 = 0,
num_flushed2 = 0;
UNUSED(num_flushed1);
p_ccb = l2cu_find_ccb_by_cid(NULL, lcid);
if ( !p_ccb || ((p_lcb = p_ccb->p_lcb) == NULL) ) {
@@ -7,6 +7,10 @@ set(COMPONENTS main)
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(test_csi)
# TODO IDF-15784: remove
# esp_cam_sensor upstream sets locals without reading them; silence -Wunused-but-set-variable
idf_component_get_property(esp_cam_sensor_lib espressif__esp_cam_sensor COMPONENT_LIB)
target_compile_options(${esp_cam_sensor_lib} PRIVATE -Wno-unused-but-set-variable)
message(STATUS "Checking camera registers are not read-write by half-word")
include($ENV{IDF_PATH}/tools/ci/check_register_rw_half_word.cmake)
+1 -1
View File
@@ -602,7 +602,7 @@ static void check_and_destroy_final_default(void)
{
_lock_acquire_recursive(&s_retention.lock);
assert(s_retention.highpri == SLEEP_RETENTION_REGDMA_LINK_LOWEST_PRIORITY);
uint32_t created_modules = 0;
uint32_t __attribute__((unused)) created_modules = 0;
for (int i = 0; i < SLEEP_RETENTION_MODULE_BITMAP_SZ; i++) {
created_modules |= s_retention.created_modules.bitmap[i];
}
@@ -562,17 +562,6 @@ typedef uint64_t benchmark_tick_t; /* unit: microseconds */
#define benchmark_print_units(type, x) printf("%s us: %lu\n", type, (unsigned long)(x))
#endif
#define N 4096
const uint32_t ro_tbl[N] = { 2 };
uint32_t scan_tbl(const volatile uint32_t *p, size_t n)
{
uint32_t sum = 0;
for (size_t i = 0; i < n; i++) {
sum += p[i];
}
return sum;
}
void test_posix_timers_clock_performance(clockid_t clock_id)
{
const int MEASUREMENTS = 5000;
@@ -584,14 +573,10 @@ void test_posix_timers_clock_performance(clockid_t clock_id)
benchmark_tick_t delta;
benchmark_tick_t delta_sum = 0;
for (int i = 0; i < PHASE_COUNT; i++) {
volatile uint32_t table_sum = 0;
if (i == PHASE_COUNT / 2) {
printf("With table scan...\n");
}
for (int j = 0; j < MEASUREMENTS; j++) {
if (i >= PHASE_COUNT / 2) {
table_sum += scan_tbl(ro_tbl, N);
}
start = get_start();
clock_settime(clock_id, &ts);
end = get_end();
+9
View File
@@ -208,6 +208,15 @@ if(CONFIG_LWIP_ENABLE)
-Wno-array-parameter
)
# TODO IDF-15784: remove
# vars only used in LWIP_ASSERT / debug; unused when asserts disabled
set_source_files_properties(
lwip/src/core/netif.c
lwip/src/core/ipv4/ip4_napt.c
PROPERTIES COMPILE_FLAGS
-Wno-unused-but-set-variable
)
if(CONFIG_COMPILER_STATIC_ANALYZER AND CONFIG_IDF_TOOLCHAIN_GCC)
set_source_files_properties(
lwip/src/core/ipv4/ip4_addr.c
+8
View File
@@ -395,6 +395,14 @@ if(CONFIG_ESP_WIFI_ENABLE_WPA3_OWE_SOFTAP)
endif()
set_property(TARGET ${COMPONENT_LIB} APPEND PROPERTY LINK_INTERFACE_MULTIPLICITY 3)
# TODO IDF-15784: remove
# variables can be unused, need to patch submodule
set_source_files_properties(
esp_supplicant/src/esp_common.c
PROPERTIES COMPILE_FLAGS
-Wno-unused-but-set-variable
)
if(CONFIG_COMPILER_STATIC_ANALYZER AND CONFIG_IDF_TOOLCHAIN_GCC)
set(eloop_analyzer_flags
-Wno-analyzer-out-of-bounds