From 54ed6154eb40201442bc6be36ed53b569cd7ae67 Mon Sep 17 00:00:00 2001 From: David Woodhouse Date: Thu, 11 Dec 2025 22:49:32 +0900 Subject: [PATCH] Expand non-const comment --- esphome/core/buildinfo.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/esphome/core/buildinfo.cpp b/esphome/core/buildinfo.cpp index 912b506790..839bee9857 100644 --- a/esphome/core/buildinfo.cpp +++ b/esphome/core/buildinfo.cpp @@ -22,7 +22,11 @@ namespace esphome { namespace buildinfo { // Reference the linker symbols as uintptr_t from the *data* section to -// avoid issues with pc-relative relocations on 64-bit platforms. +// avoid issues with pc-relative relocations on 64-bit platforms. And +// don't let the compiler know they're const or it'll optimise away the +// whole thing and emit a relocation to the ESPHOME_XXX symbols above +// directly, which defaults the whole point! +// // 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;