diff --git a/components/esp_libc/platform_include/sys/cdefs.h b/components/esp_libc/platform_include/sys/cdefs.h index d87dbd85aa0..316a4645ccc 100644 --- a/components/esp_libc/platform_include/sys/cdefs.h +++ b/components/esp_libc/platform_include/sys/cdefs.h @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2025-2026 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -10,3 +10,14 @@ #include #include #endif + +#if CONFIG_LIBC_PICOLIBC // TODO IDF-15569 +#undef __noreturn +#if __has_attribute(__noreturn__) +#define __noreturn __attribute__((__noreturn__)) +#else +#define __noreturn +#endif +#else +#define __noreturn +#endif diff --git a/components/hal/platform_port/include/hal/assert.h b/components/hal/platform_port/include/hal/assert.h index c8db9b4c872..1eed2c74494 100644 --- a/components/hal/platform_port/include/hal/assert.h +++ b/components/hal/platform_port/include/hal/assert.h @@ -12,9 +12,11 @@ extern "C" { #endif #if CONFIG_LIBC_PICOLIBC -#if defined(__cplusplus) && __cplusplus >= 201103L -#define __noreturn [[noreturn]] -#elif __has_attribute(__noreturn__) +// TODO IDF-15569 +// #if defined(__cplusplus) && __cplusplus >= 201103L +// #define __noreturn [[noreturn]] +// #elif __has_attribute(__noreturn__) +#if __has_attribute(__noreturn__) #define __noreturn __attribute__((__noreturn__)) #else #define __noreturn