[riot-notifications] [RIOT-OS/RIOT] fmt: fix fmt_s32_dec() and fmt_s64_dec() sign bit handling (#10784)

Kaspar Schleiser notifications at github.com
Wed Jan 16 16:49:43 CET 2019


> Wouldn't make any sense either, because you are clearly changing behavior. How about adding a unittest for the corner case pointed out in OP?

There actually is one, which is how ubsan got triggered. The tests executes fine.

I did some digging. IMO the compiler gets confused here:

- If only fmt_s32_dec() is "fixed", code size stays the same.
- If only fmt_s64_dec() is "fixed", code size increases by 4 bytes.
- if both are "fixed", code size increases by 8 bytes

(tested compiling for samr21-xpro).

Hm, I'd really like to see all the unittests complete without triggering undefined behaviour. Is that worth 8 bytes?



-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/10784#issuecomment-454828592
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190116/86b17d3f/attachment.html>


More information about the notifications mailing list