build(core): silence clang warning for moductypes.c
What changed, and why it matters
This commit only changes a build script to suppress a compiler warning. It does not fix a security bug, change runtime behavior, or alter any device firmware code. The warning was about a string being slightly too long for its container in a third-party MicroPython file, and the project chose to silence the warning rather than modify the upstream code. There is no security issue here.
No security action needed. This is a benign build-system change. If desired, verify that the suppressed warning does not mask any actual runtime issue in moductypes.c, though the commit message indicates the underlying pattern is already addressed in newer MicroPython.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit modifies core/embed/upymod/build.rs to add a per-file compiler flag, -Wno-unterminated-string-initialization, for extmod/moductypes.c. The flag disables a clang warning triggered because a string literal of length 17 (including the null terminator) is placed into a 16-byte array. The file is moved from the default source list to a separate call with custom compile attributes. The commit message explicitly frames this as a build hygiene change pending a future MicroPython upgrade.
Changed components
core/embed/upymod/build.rsInspect captured patch +10 / −1
diff --git a/core/embed/upymod/build.rs b/core/embed/upymod/build.rs
index 7a90747a..ea0b8710 100644
--- a/core/embed/upymod/build.rs
+++ b/core/embed/upymod/build.rs
@@ -118,11 +118,20 @@ fn main() -> Result<()> {
lib.add_sources_in_dir_with_attrs(mpy_dir, ["py/gc.c", "py/pystack.c", "py/vm.c"], attrs);
+ // silence warning about unterminated string literals
+ // TODO: remove this after we upgrade MicroPython
+ let attrs_silence_unterminated =
+ xbuild::CompileAttrs::new().with_flag("-Wno-unterminated-string-initialization");
+ lib.add_sources_in_dir_with_attrs(
+ mpy_dir,
+ ["extmod/moductypes.c"],
+ Some(attrs_silence_unterminated),
+ );
+
lib.add_sources_in_dir(
mpy_dir,
[
"extmod/modubinascii.c",
- "extmod/moductypes.c",
"extmod/moduheapq.c",
"extmod/modutimeq.c",
"extmod/utime_mphal.c",
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.