[core] Use constexpr for PROGMEM arrays

Change progmem_array codegen from `static const` to `static constexpr`.
This ensures the compiler evaluates the array at compile time with no
runtime initialization, and is the correct qualifier for constant data
known at compile time.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
J. Nick Koston
2026-02-19 16:30:16 -06:00
parent bd50b80882
commit 6608b3493c

View File

@@ -424,7 +424,7 @@ class ProgmemAssignmentExpression(AssignmentExpression):
super().__init__(type_, "", name, rhs)
def __str__(self):
return f"static const {self.type} {self.name}[] PROGMEM = {self.rhs}"
return f"static constexpr {self.type} {self.name}[] PROGMEM = {self.rhs}"
class StaticConstAssignmentExpression(AssignmentExpression):