mirror of
https://github.com/esphome/esphome.git
synced 2026-10-07 03:16:37 +00:00
[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:
co-authored by
Claude Opus 4.6
parent
bd50b80882
commit
41346716cc
@@ -325,7 +325,7 @@ class TestStatements:
|
||||
),
|
||||
(
|
||||
cg.ProgmemAssignmentExpression(ct.uint16, "foo", "bar"),
|
||||
'static const uint16_t foo[] PROGMEM = "bar"',
|
||||
'static constexpr uint16_t foo[] PROGMEM = "bar"',
|
||||
),
|
||||
),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user