bergzand / NanoCBOR

CBOR library aimed at heavily constrained devices
Creative Commons Zero v1.0 Universal
47 stars 23 forks source link

decoder: fix build on AVR #75

Closed benpicco closed 2 years ago

benpicco commented 2 years ago

This fixes the build issue on AVR:

/home/benpicco/dev/RIOT/build/pkg/nanocbor/src/decoder.c: In function ‘_decode_half_float’:
/home/benpicco/dev/RIOT/build/pkg/nanocbor/src/decoder.c:400:62: error: left shift count >= width of type [-Werror=shift-count-overflow]
         static const uint32_t magic = (FLOAT_EXP_OFFSET - 1) << FLOAT_EXP_POS;
                                                              ^
/home/benpicco/dev/RIOT/build/pkg/nanocbor/src/decoder.c:400:39: error: initializer element is not a constant expression [-Werror]
         static const uint32_t magic = (FLOAT_EXP_OFFSET - 1) << FLOAT_EXP_POS;
                                       ^
cc1: all warnings being treated as errors
bergzand commented 2 years ago

Thanks!