Merge branch 'fix/cxx_noreturn_issue' into 'master'

fix(libc): picolibc: workaround wrong pthread_exit declaration for c++

See merge request espressif/esp-idf!47690
This commit is contained in:
Alexey Lapshin
2026-04-23 12:47:12 +04:00
2 changed files with 17 additions and 4 deletions
@@ -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 <stdint.h>
#include <stddef.h>
#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
@@ -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