From 88a430dbe38d2aed1c9c36e2ae18eff8a889bd4a Mon Sep 17 00:00:00 2001 From: Marius Vikhammer Date: Thu, 28 Aug 2025 10:28:00 +0800 Subject: [PATCH] fix(lp_core): fixed array-bound warning when compiling on P4 with -Os Closes https://github.com/espressif/esp-idf/issues/17054 --- components/ulp/lp_core/lp_core.c | 2 +- .../lp_core/lp_core_basic_tests/main/test_lp_core_i2c.c | 4 ++++ .../lp_core/lp_core_basic_tests/sdkconfig.ci.release | 3 +++ 3 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 components/ulp/test_apps/lp_core/lp_core_basic_tests/sdkconfig.ci.release diff --git a/components/ulp/lp_core/lp_core.c b/components/ulp/lp_core/lp_core.c index 6498c11e80..13d6e96daa 100644 --- a/components/ulp/lp_core/lp_core.c +++ b/components/ulp/lp_core/lp_core.c @@ -36,7 +36,7 @@ const static char* TAG = "ulp-lp-core"; #define WAKEUP_SOURCE_MAX_NUMBER 5 -#define RESET_HANDLER_ADDR (intptr_t)(&_rtc_ulp_memory_start + 0x80 / 4) // Placed after the 0x80 byte long vector table +#define RESET_HANDLER_ADDR ((intptr_t)&_rtc_ulp_memory_start + 0x80) // Placed after the 0x80 byte long vector table /* Maps the flags defined in ulp_lp_core.h e.g. ULP_LP_CORE_WAKEUP_SOURCE_HP_CPU to their actual HW values */ static uint32_t wakeup_src_sw_to_hw_flag_lookup[WAKEUP_SOURCE_MAX_NUMBER] = { diff --git a/components/ulp/test_apps/lp_core/lp_core_basic_tests/main/test_lp_core_i2c.c b/components/ulp/test_apps/lp_core/lp_core_basic_tests/main/test_lp_core_i2c.c index a34b973dba..a2885ecf76 100644 --- a/components/ulp/test_apps/lp_core/lp_core_basic_tests/main/test_lp_core_i2c.c +++ b/components/ulp/test_apps/lp_core/lp_core_basic_tests/main/test_lp_core_i2c.c @@ -81,7 +81,11 @@ static void i2c_master_write_read_test(void) uint8_t *wr_data = (uint8_t*)&ulp_data_wr; for (int i = 0; i < RW_TEST_LENGTH; i++) { +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wstringop-overflow" +#pragma GCC diagnostic ignored "-Warray-bounds" wr_data[i] = expected_master_write_data[i]; +#pragma GCC diagnostic pop } unity_wait_for_signal("master write"); diff --git a/components/ulp/test_apps/lp_core/lp_core_basic_tests/sdkconfig.ci.release b/components/ulp/test_apps/lp_core/lp_core_basic_tests/sdkconfig.ci.release new file mode 100644 index 0000000000..3cff15d49e --- /dev/null +++ b/components/ulp/test_apps/lp_core/lp_core_basic_tests/sdkconfig.ci.release @@ -0,0 +1,3 @@ +CONFIG_COMPILER_OPTIMIZATION_SIZE=y +CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_SIZE=y +CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_SILENT=y