MaJerle / lwprintf

Lightweight printf library optimized for embedded systems
https://majerle.eu/projects/lwprintf-lightweight-stdio-manager-printf-snprintf-vprintf-vsnprintf-sprintf
MIT License
186 stars 32 forks source link

The library does not compile #4

Closed DmiKarasev closed 3 years ago

DmiKarasev commented 3 years ago

Hello, Tilen MaJerle!

I used the develop-version of this interesting library before I noticed that you made a v1.0.0 release. When I updated to v1.0.0 with my opts used before (#define LWPRINTF_CFG_OS 1, #define LWPRINTF_CFG_SUPPORT_TYPE_POINTER 0, #define LWPRINTF_CFG_SUPPORT_TYPE_ENGINEERING 0), the library cannot compile due to #define LWPRINTF_CFG_SUPPORT_TYPE_ENGINEERING 0. The error appears on this line

https://github.com/MaJerle/lwprintf/blob/f67bf4360f80532ee7f73ae2c002c9245ec384ab/lwprintf/src/lwprintf/lwprintf.c#L791

digits_cnt_decimal_part_useful is member of float_num_t when LWPRINTF_CFG_SUPPORT_TYPE_ENGINEERING == 1

Is it a bug?

MaJerle commented 3 years ago

Thanks, I have fixed it. It actually needs this field even if engineering mode is disabled.

https://github.com/MaJerle/lwprintf/commit/d8beaa6a303e28eaa4910fbb5f4a053d1191bbcf