chore(core): add error string to static_assert
What changed, and why it matters
This is a trivial one-line change that adds a human-readable error message to a compile-time size check. It does not change any logic, behavior, or security boundary. It only suppresses a compiler warning in newer versions of clang.
No security action needed. Treat as a normal build hygiene / compiler warning fix.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch changes _Static_assert(sizeof(event->data) <= 6); to _Static_assert(sizeof(event->data) <= 6, "pairing code is too long"); in a MicroPython C module header. C23 requires a diagnostic string for static assertions, and clang 21 emits a warning when it is missing. The assertion’s predicate and the surrounding parsing code are unchanged.
Changed components
core/embed/upymod/modtrezorio/modtrezorio-poll.hInspect captured patch +1 / −1
diff --git a/core/embed/upymod/modtrezorio/modtrezorio-poll.h b/core/embed/upymod/modtrezorio/modtrezorio-poll.h
index 9a50b18f5..0ed42d67f 100644
--- a/core/embed/upymod/modtrezorio/modtrezorio-poll.h
+++ b/core/embed/upymod/modtrezorio/modtrezorio-poll.h
@@ -53,7 +53,7 @@ static mp_obj_t parse_ble_event_data(const ble_event_t *event) {
return mp_const_none;
}
// Parse pairing code
- _Static_assert(sizeof(event->data) <= 6);
+ _Static_assert(sizeof(event->data) <= 6, "pairing code is too long");
uint32_t code = 0;
for (int i = 0; i < event->data_len; ++i) {
uint8_t byte = event->data[i];
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.