"noreturn attribute ignored" warning with ESP-IDF v5.0.1

RobMeades
Posts: 85
Joined: Thu Nov 29, 2018 1:12 pm

"noreturn attribute ignored" warning with ESP-IDF v5.0.1

Postby RobMeades » Thu May 04, 2023 9:19 pm

Hi there. Compiling with ESP-IDF v5.0.1, downloaded just now (we've just updated from v4.3.2), I'm getting some additional warnings from within the ESP-IDF header files themselves about the noreturn attribute being ignored, see below. Is this (a) just a "fact of life" given where version 5 is at the moment, or (b) might I be doing something wrong, or (c) should I be suppressing them, etc...?

Code: Select all

In file included from /home/ubxlib/.ubxlibpkg/esp_idf-v5.0.1/components/esp_hw_support/include/esp_intr_alloc.h:11,
                 from /home/ubxlib/.ubxlibpkg/esp_idf-v5.0.1/components/esp_hw_support/include/esp_cpu.h:20,
                 from /home/ubxlib/.ubxlibpkg/esp_idf-v5.0.1/components/esp_hw_support/include/spinlock.h:11,
                 from /home/ubxlib/.ubxlibpkg/esp_idf-v5.0.1/components/freertos/FreeRTOS-Kernel/portable/xtensa/include/freertos/portmacro.h:74,
                 from /home/ubxlib/.ubxlibpkg/esp_idf-v5.0.1/components/freertos/FreeRTOS-Kernel/include/freertos/portable.h:58,
                 from /home/ubxlib/.ubxlibpkg/esp_idf-v5.0.1/components/freertos/FreeRTOS-Kernel/include/freertos/FreeRTOS.h:70,
                 from /home/ubxlib/workspace/ubxlib_feature_espidf_v5_rmea@2/ubxlib/port/platform/esp-idf/src/u_port.c:36:
/home/ubxlib/.ubxlibpkg/esp_idf-v5.0.1/components/esp_common/include/esp_err.h:79:1: warning: '_Noreturn' attribute directive ignored [-Wattributes]
   79 | void _esp_error_check_failed(esp_err_t rc, const char *file, int line, const char *function, const char *expression) __attribute__((noreturn));
      | ^~~~
In file included from /home/ubxlib/.ubxlibpkg/esp_idf-v5.0.1/components/freertos/FreeRTOS-Kernel/portable/xtensa/include/freertos/portmacro.h:83,
                 from /home/ubxlib/.ubxlibpkg/esp_idf-v5.0.1/components/freertos/FreeRTOS-Kernel/include/freertos/portable.h:58,
                 from /home/ubxlib/.ubxlibpkg/esp_idf-v5.0.1/components/freertos/FreeRTOS-Kernel/include/freertos/FreeRTOS.h:70,
                 from /home/ubxlib/workspace/ubxlib_feature_espidf_v5_rmea@2/ubxlib/port/platform/esp-idf/src/u_port.c:36:
/home/ubxlib/.ubxlibpkg/esp_idf-v5.0.1/components/esp_system/include/esp_system.h:75:1: warning: '_Noreturn' attribute directive ignored [-Wattributes]
   75 | void esp_restart(void) __attribute__ ((noreturn));
      | ^~~~
/home/ubxlib/.ubxlibpkg/esp_idf-v5.0.1/components/esp_system/include/esp_system.h:115:1: warning: '_Noreturn' attribute directive ignored [-Wattributes]
  115 | void  __attribute__((noreturn)) esp_system_abort(const char* details);
      | ^~~~

RobMeades
Posts: 85
Joined: Thu Nov 29, 2018 1:12 pm

Re: "noreturn attribute ignored" warning with ESP-IDF v5.0.1

Postby RobMeades » Fri May 05, 2023 1:13 pm

I have posted this as an issue in https://github.com/espressif/esp-idf/issues/11339.

bidrohini
Posts: 202
Joined: Thu Oct 27, 2022 12:55 pm

Re: "noreturn attribute ignored" warning with ESP-IDF v5.0.1

Postby bidrohini » Fri May 05, 2023 2:10 pm

These warnings are caused by a known issue in ESP-IDF v5.0.1 related to the _Noreturn attribute and are being generated from within the ESP-IDF header files themselves. This issue has been reported to the ESP-IDF developers and is expected to be resolved in a future release.

The _Noreturn attribute is used to indicate that a function does not return to the caller. However, this is not an error. I think you can ignore it.

RobMeades
Posts: 85
Joined: Thu Nov 29, 2018 1:12 pm

Re: "noreturn attribute ignored" warning with ESP-IDF v5.0.1

Postby RobMeades » Thu May 11, 2023 9:32 am

Great, thanks for confirming, it is currently being ignored.

Who is online

Users browsing this forum: Google [Bot] and 175 guests