Skip to content

Commit 599c14d

Browse files
committed
Merge branch 'feature/update-toolchain-to-esp-14.2.0_20240903' into 'master'
feat(tools): update toolchain version to esp-14.2.0_20240906 Closes IDFGH-13033, IDFGH-13355, and IDFGH-13360 See merge request espressif/esp-idf!33295
2 parents 2014e5a + 57d39c3 commit 599c14d

File tree

47 files changed

+284
-168
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+284
-168
lines changed

CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,10 @@ if(CONFIG_COMPILER_DISABLE_GCC13_WARNINGS)
175175
"-Wno-dangling-reference")
176176
endif()
177177

178+
if(CONFIG_COMPILER_DISABLE_GCC14_WARNINGS)
179+
list(APPEND compile_options "-Wno-calloc-transposed-args")
180+
endif()
181+
178182
if(CONFIG_COMPILER_DISABLE_DEFAULT_ERRORS)
179183
if(NOT CMAKE_C_COMPILER_ID MATCHES "Clang")
180184
idf_build_replace_option_from_property(COMPILE_OPTIONS "-Werror" "-Werror=all")

Kconfig

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -587,6 +587,13 @@ mainmenu "Espressif IoT Development Framework Configuration"
587587
Enable this option if use GCC 13 or newer, and want to disable warnings which don't appear with
588588
GCC 12.
589589

590+
config COMPILER_DISABLE_GCC14_WARNINGS
591+
bool "Disable new warnings introduced in GCC 14"
592+
default "n"
593+
help
594+
Enable this option if use GCC 14 or newer, and want to disable warnings which don't appear with
595+
GCC 13.
596+
590597
config COMPILER_DUMP_RTL_FILES
591598
bool "Dump RTL files during compilation"
592599
help

components/app_update/esp_ota_ops.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ esp_err_t esp_ota_begin(const esp_partition_t *partition, size_t image_size, esp
157157
}
158158
}
159159

160-
new_entry = (ota_ops_entry_t *) calloc(sizeof(ota_ops_entry_t), 1);
160+
new_entry = (ota_ops_entry_t *) calloc(1, sizeof(ota_ops_entry_t));
161161
if (new_entry == NULL) {
162162
return ESP_ERR_NO_MEM;
163163
}

components/bt/host/bluedroid/bta/dm/bta_dm_act.c

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2385,7 +2385,12 @@ void bta_dm_queue_search (tBTA_DM_MSG *p_data)
23852385
osi_free(bta_dm_search_cb.p_search_queue);
23862386
}
23872387

2388-
bta_dm_search_cb.p_search_queue = (tBTA_DM_MSG *)osi_malloc(sizeof(tBTA_DM_API_SEARCH));
2388+
tBTA_DM_API_SEARCH *search_queue = osi_malloc(sizeof(tBTA_DM_API_SEARCH));
2389+
if (search_queue == NULL) {
2390+
APPL_TRACE_ERROR("%s: couldn't allocate memory", __func__);
2391+
return;
2392+
}
2393+
bta_dm_search_cb.p_search_queue = (tBTA_DM_MSG *) search_queue;
23892394
memcpy(bta_dm_search_cb.p_search_queue, p_data, sizeof(tBTA_DM_API_SEARCH));
23902395

23912396
}
@@ -2406,7 +2411,12 @@ void bta_dm_queue_disc (tBTA_DM_MSG *p_data)
24062411
osi_free(bta_dm_search_cb.p_search_queue);
24072412
}
24082413

2409-
bta_dm_search_cb.p_search_queue = (tBTA_DM_MSG *)osi_malloc(sizeof(tBTA_DM_API_DISCOVER));
2414+
tBTA_DM_API_DISCOVER *search_queue = osi_malloc(sizeof(tBTA_DM_API_DISCOVER));
2415+
if (search_queue == NULL) {
2416+
APPL_TRACE_ERROR("%s: couldn't allocate memory", __func__);
2417+
return;
2418+
}
2419+
bta_dm_search_cb.p_search_queue = (tBTA_DM_MSG *)search_queue;
24102420
memcpy(bta_dm_search_cb.p_search_queue, p_data, sizeof(tBTA_DM_API_DISCOVER));
24112421
}
24122422
#endif ///SDP_INCLUDED == TRUE

components/esp_common/include/esp_macros.h

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD
2+
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*/
@@ -11,6 +11,7 @@ This header contains various general purpose helper macros used across ESP-IDF
1111
*/
1212
#include <assert.h>
1313
#include "esp_assert.h"
14+
#include "esp_compiler.h"
1415

1516
#ifdef __cplusplus
1617
extern "C" {
@@ -51,7 +52,7 @@ extern "C" {
5152
* - __GET_NTH_ARG__() takes args >= N (64) but only expand to Nth one (64th)
5253
* - __RSEQ_N__() is reverse sequential to N to add padding to have Nth
5354
* position is the same as the number of arguments
54-
* - ##__VA_ARGS__ is used to deal with 0 paramerter (swallows comma)
55+
* - ##__VA_ARGS__ is used to deal with 0 parameter (swallows comma)
5556
*/
5657
#ifndef __VA_NARG__
5758
# define __VA_NARG__(...) __NARG__(_0, ##__VA_ARGS__, __RSEQ_N__())
@@ -98,6 +99,13 @@ ESP_STATIC_ASSERT(foo(42, 87) == 1, "CHOOSE_MACRO_VA_ARG() result does not match
9899
#undef foo_args
99100
#undef foo_no_args
100101

102+
#define ESP_INFINITE_LOOP() \
103+
do { \
104+
ESP_COMPILER_DIAGNOSTIC_PUSH_IGNORE("-Wanalyzer-infinite-loop") \
105+
while(1); \
106+
ESP_COMPILER_DIAGNOSTIC_POP("-Wanalyzer-infinite-loop") \
107+
} while(1)
108+
101109
#ifdef __cplusplus
102110
}
103111
#endif

components/esp_driver_dac/esp32/dac_dma.c

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* SPDX-FileCopyrightText: 2019-2023 Espressif Systems (Shanghai) CO LTD
2+
* SPDX-FileCopyrightText: 2019-2024 Espressif Systems (Shanghai) CO LTD
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*/
@@ -149,17 +149,19 @@ esp_err_t dac_dma_periph_init(uint32_t freq_hz, bool is_alternate, bool is_apll)
149149

150150
esp_err_t dac_dma_periph_deinit(void)
151151
{
152+
if (!s_ddp) {
153+
return ESP_OK;
154+
}
155+
152156
ESP_RETURN_ON_FALSE(s_ddp->intr_handle == NULL, ESP_ERR_INVALID_STATE, TAG, "The interrupt is not deregistered yet");
153157
ESP_RETURN_ON_ERROR(i2s_platform_release_occupation(I2S_CTLR_HP, DAC_DMA_PERIPH_I2S_NUM), TAG, "Failed to release DAC DMA peripheral");
154158
i2s_ll_enable_intr(s_ddp->periph_dev, I2S_LL_EVENT_TX_EOF | I2S_LL_EVENT_TX_TEOF, false);
155-
if (s_ddp) {
156-
if (s_ddp->use_apll) {
157-
periph_rtc_apll_release();
158-
s_ddp->use_apll = false;
159-
}
160-
free(s_ddp);
161-
s_ddp = NULL;
159+
if (s_ddp->use_apll) {
160+
periph_rtc_apll_release();
161+
s_ddp->use_apll = false;
162162
}
163+
free(s_ddp);
164+
s_ddp = NULL;
163165

164166
return ESP_OK;
165167
}

components/esp_driver_dac/esp32s2/dac_dma.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ esp_err_t dac_dma_periph_init(uint32_t freq_hz, bool is_alternate, bool is_apll)
158158

159159
esp_err_t dac_dma_periph_deinit(void)
160160
{
161+
ESP_RETURN_ON_FALSE(s_ddp != NULL, ESP_ERR_INVALID_STATE, TAG, "DAC DMA peripheral is not initialized");
161162
ESP_RETURN_ON_FALSE(s_ddp->intr_handle == NULL, ESP_ERR_INVALID_STATE, TAG, "The interrupt is not deregistered yet");
162163
if (s_ddp->dma_chan) {
163164
ESP_RETURN_ON_ERROR(spicommon_dma_chan_free(s_ddp->spi_dma_ctx), TAG, "Failed to free dma peripheral channel");

components/esp_driver_spi/src/gpspi/spi_slave_hd.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* SPDX-License-Identifier: Apache-2.0
55
*/
66

7+
#include "esp_compiler.h"
78
#include "esp_log.h"
89
#include "esp_check.h"
910
#include "esp_memory_utils.h"
@@ -606,7 +607,9 @@ static esp_err_t s_spi_slave_hd_setup_priv_trans(spi_host_device_t host, spi_sla
606607
}
607608
}
608609
if (chan == SPI_SLAVE_CHAN_TX) {
610+
ESP_COMPILER_DIAGNOSTIC_PUSH_IGNORE("-Wanalyzer-overlapping-buffers") // TODO IDF-11086
609611
memcpy(priv_trans->aligned_buffer, orig_trans->data, orig_trans->len);
612+
ESP_COMPILER_DIAGNOSTIC_POP("-Wanalyzer-overlapping-buffers")
610613
esp_err_t ret = esp_cache_msync((void *)priv_trans->aligned_buffer, byte_len, ESP_CACHE_MSYNC_FLAG_DIR_C2M);
611614
ESP_RETURN_ON_FALSE(ESP_OK == ret, ESP_ERR_INVALID_STATE, TAG, "mem sync c2m(writeback) fail");
612615
} else {

components/esp_http_server/src/httpd_uri.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,11 +146,13 @@ esp_err_t httpd_register_uri_handler(httpd_handle_t handle,
146146

147147
for (int i = 0; i < hd->config.max_uri_handlers; i++) {
148148
if (hd->hd_calls[i] == NULL) {
149+
ESP_COMPILER_DIAGNOSTIC_PUSH_IGNORE("-Wanalyzer-malloc-leak") // False-positive detection. TODO GCC-366
149150
hd->hd_calls[i] = malloc(sizeof(httpd_uri_t));
150151
if (hd->hd_calls[i] == NULL) {
151152
/* Failed to allocate memory */
152153
return ESP_ERR_HTTPD_ALLOC_MEM;
153154
}
155+
ESP_COMPILER_DIAGNOSTIC_POP("-Wanalyzer-malloc-leak")
154156

155157
/* Copy URI string */
156158
hd->hd_calls[i]->uri = strdup(uri_handler->uri);

components/esp_hw_support/esp_clock_output.c

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -55,18 +55,22 @@ static clkout_channel_handle_t* clkout_channel_alloc(soc_clkout_sig_id_t clk_sig
5555
clkout_channel_handle_t *allocated_channel = NULL;
5656

5757
#if SOC_GPIO_CLOCKOUT_BY_IO_MUX
58-
portENTER_CRITICAL(&s_clkout_handle[IONUM_TO_CLKOUT_CHANNEL(gpio_num)].clkout_channel_lock);
59-
if (!s_clkout_handle[IONUM_TO_CLKOUT_CHANNEL(gpio_num)].is_mapped) {
60-
s_clkout_handle[IONUM_TO_CLKOUT_CHANNEL(gpio_num)].is_mapped = true;
61-
allocated_channel = &s_clkout_handle[IONUM_TO_CLKOUT_CHANNEL(gpio_num)];
62-
} else if ((s_clkout_handle[IONUM_TO_CLKOUT_CHANNEL(gpio_num)].mapped_io_bmap & BIT(gpio_num)) &&
63-
(s_clkout_handle[IONUM_TO_CLKOUT_CHANNEL(gpio_num)].mapped_clock == clk_sig)) {
64-
allocated_channel = &s_clkout_handle[IONUM_TO_CLKOUT_CHANNEL(gpio_num)];
58+
int32_t channel_num = IONUM_TO_CLKOUT_CHANNEL(gpio_num);
59+
if (channel_num < 0) {
60+
return NULL;
61+
}
62+
portENTER_CRITICAL(&s_clkout_handle[channel_num].clkout_channel_lock);
63+
if (!s_clkout_handle[channel_num].is_mapped) {
64+
s_clkout_handle[channel_num].is_mapped = true;
65+
allocated_channel = &s_clkout_handle[channel_num];
66+
} else if ((s_clkout_handle[channel_num].mapped_io_bmap & BIT(gpio_num)) &&
67+
(s_clkout_handle[channel_num].mapped_clock == clk_sig)) {
68+
allocated_channel = &s_clkout_handle[channel_num];
6569
}
6670
if (allocated_channel != NULL) {
67-
allocated_channel->channel_id = (clock_out_channel_t)IONUM_TO_CLKOUT_CHANNEL(gpio_num);
71+
allocated_channel->channel_id = (clock_out_channel_t)channel_num;
6872
}
69-
portEXIT_CRITICAL(&s_clkout_handle[IONUM_TO_CLKOUT_CHANNEL(gpio_num)].clkout_channel_lock);
73+
portEXIT_CRITICAL(&s_clkout_handle[channel_num].clkout_channel_lock);
7074
#elif SOC_GPIO_CLOCKOUT_BY_GPIO_MATRIX
7175
for (uint32_t channel = 0; channel < CLKOUT_CHANNEL_MAX; channel++) {
7276
portENTER_CRITICAL(&s_clkout_handle[channel].clkout_channel_lock);

0 commit comments

Comments
 (0)