diff --git a/esphome/core/helpers.h b/esphome/core/helpers.h index e838c82f3e..4dcd44a574 100644 --- a/esphome/core/helpers.h +++ b/esphome/core/helpers.h @@ -217,6 +217,8 @@ template class FixedVector { reset_(); if (n > 0) { // Allocate raw memory without calling constructors + // sizeof(T) is correct here - when T is a pointer type, we want the pointer size + // NOLINTNEXTLINE(bugprone-sizeof-expression) data_ = static_cast(::operator new(n * sizeof(T))); capacity_ = n; }