From 4e517b422df0e6d690118429140ae5a1955b39c9 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Wed, 29 Apr 2026 06:08:04 -0500 Subject: [PATCH 1/2] [esp8266] NOLINT redundant-declaration on system_soft_wdt_feed forward decl clang-tidy flagged the forward decl in hal_esp8266.h because also declares the function (when included via SDK headers). Both decls are identical `extern "C"` so the redundancy is harmless; suppress the warning on the hal_esp8266.h side. --- esphome/core/hal/hal_esp8266.h | 1 + 1 file changed, 1 insertion(+) diff --git a/esphome/core/hal/hal_esp8266.h b/esphome/core/hal/hal_esp8266.h index d947612bcc..04326a3579 100644 --- a/esphome/core/hal/hal_esp8266.h +++ b/esphome/core/hal/hal_esp8266.h @@ -21,6 +21,7 @@ extern "C" unsigned long millis(void); // NOLINTEND(google-runtime-int,readability-identifier-naming,readability-redundant-declaration) // Forward decl from for arch_feed_wdt() inline below. +// NOLINTNEXTLINE(readability-redundant-declaration) extern "C" void system_soft_wdt_feed(void); namespace esphome { From 4009c498d956b17dd742406f1cdabaa7b4dc5700 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Wed, 29 Apr 2026 06:50:59 -0500 Subject: [PATCH 2/2] [esp32] Fix hal.cpp include order: defines.h before crash_handler.h crash_handler.h is itself guarded by #ifdef USE_ESP32_CRASH_HANDLER, so when hal.cpp included it before defines.h, the namespace block was empty at parse time and arch_init()'s USE_ESP32_CRASH_HANDLER branch failed with: error: 'crash_handler_read_and_clear' is not a member of 'esphome::esp32' Pull defines.h first so USE_ESP32_CRASH_HANDLER is defined before crash_handler.h is parsed. --- esphome/components/esp32/hal.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/esphome/components/esp32/hal.cpp b/esphome/components/esp32/hal.cpp index 3a0836a507..f6199d557f 100644 --- a/esphome/components/esp32/hal.cpp +++ b/esphome/components/esp32/hal.cpp @@ -1,7 +1,9 @@ #ifdef USE_ESP32 -#include "crash_handler.h" +// defines.h must come before crash_handler.h so USE_ESP32_CRASH_HANDLER is set +// before crash_handler.h's #ifdef-guarded namespace block is parsed. #include "esphome/core/defines.h" +#include "crash_handler.h" #include "esphome/core/hal.h" #include