au-ts / lionsos

A secure, fast, and adaptable OS based on the seL4 microkernel
https://lionsos.org
BSD 2-Clause "Simplified" License
84 stars 12 forks source link

micropython: don't use printf 'h' format specifiers #70

Closed JE-Archer closed 4 months ago

JE-Archer commented 4 months ago

The MicroPython component uses lwIP for its socket implementation. lwIP in turn makes use of the printf provided by MicroPython. MicroPython's printf does not support the 'h' specifiers, like %hu or %hx. As such, lwIP must not call printf with these specifiers. lwIP's usage of these specifiers can be configured via the U16_F and X16_F constants in lwip_include/arch/cc.h. This commit changes those constants to use %u and %x instead of %hu and %hx.