From 0b1ea8f2ca26ffc84f7f6e97c371a51a7ff30732 Mon Sep 17 00:00:00 2001 From: David Woodhouse Date: Thu, 11 Dec 2025 22:48:02 +0900 Subject: [PATCH] Add nolint for non-const buildinfo variables Variables must remain non-const to prevent compiler optimization that would bypass the indirection workaround for PC-relative relocation issues. --- esphome/core/buildinfo.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/esphome/core/buildinfo.cpp b/esphome/core/buildinfo.cpp index 28d1479240..912b506790 100644 --- a/esphome/core/buildinfo.cpp +++ b/esphome/core/buildinfo.cpp @@ -23,8 +23,10 @@ namespace buildinfo { // Reference the linker symbols as uintptr_t from the *data* section to // avoid issues with pc-relative relocations on 64-bit platforms. +// NOLINTBEGIN(cppcoreguidelines-avoid-non-const-global-variables) static uintptr_t config_hash = (uintptr_t) &ESPHOME_CONFIG_HASH; static uintptr_t build_time = (uintptr_t) &ESPHOME_BUILD_TIME; +// NOLINTEND(cppcoreguidelines-avoid-non-const-global-variables) const char *get_config_hash() { static char hash_str[9];