1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 00:29:46 +01:00
RIOT/sys/matstat
Marian Buschsieweke 54f4cd7cd1
sys/matstat: fix compilation with newlib
newlib (nano) does not support 64 bit types (neither in stdio nor with
corresponding `PRI*64` macros). With GCC 13.2.1 (as shipped in Ubuntu
24.04.1 LTS), this triggers the following compilation error (even with
`ENABLE_DEBUG == 0`):

    sys/matstat/matstat.c:57:21: error: expected ')' before 'PRIu64'
       57 |     DEBUG("Var: (%" PRIu64 " / (%" PRId32 " - 1)) = %" PRIu64 "\n",
          |                     ^~~~~~

This fixes the issue by falling back to printing 32 bit values when
the `PRIu64` macro is not defined. A `!trunc` is appended when the
64 bit exceeds the range of [0:UINT32_MAX].
2024-10-09 22:23:40 +02:00
..
doc.txt sys/matstat: change ingroup directive 2018-08-24 18:14:03 +02:00
Makefile sys/matstat: Integer mathematical statistics library 2018-04-28 08:03:35 +02:00
matstat.c sys/matstat: fix compilation with newlib 2024-10-09 22:23:40 +02:00