4 ms·
Show HN: Mini_printf – minimal, self-contained and verified printf()
- DanWaterworth 11y agoCalling it verified seems like a stretch. When I think verified, I think seL4, CompCert, etc. The role of testing isn't verification, it's falsification.
- wkoszek 11y agoI agree it's a mistake. I made the change to the README.md and gave you a credit for spotting it. https://github.com/wkoszek/mini_printf/commit/fb096cabb5dcba3a1e081a68d9d3f1001ccc5f23 https://github.com/wkoszek/mini_printf/commit/fb096cabb5dcba...
- markrages 11y agotypedef unsigned int u32; typedef unsigned long u64; This does not look like portable code.
- wkoszek 11y agoThe problem is that I didn't want to make this code depend on stdint.h So yeah - depending on the platform you will need to make u32/u64 point to things from your stdint.h (or whatever that is) and the code should work.
- pdw 11y agoThough your code converts the input int to u32 when calling vpf_num_to_str. That will fail if int happens to be more than 32 bits long. Anyway, a less theoretical bug report: Your "%d" format specifier fails to print negative numbers. :)
- jotux 11y ago>I didn't want to make this code depend on stdint.h Why?
- wkoszek 11y agoSome environments don't have stdint.h
- rffn 11y agoYour code does not seem to mention its license anywhere. This makes it impossible to use in most projects. For commercial embedded a BSD-style license seems to be better. For using it in GPL software GPL would work better. IANAL but without a license and a copyright notice depending on the country the viewer is in it might be even up for grabs for them to put on their own copyright and license.
- wkoszek 11y agoGood point, since I forgot. It's a BSDv2 code. Credit goes to you: https://github.com/wkoszek/mini_printf/commit/1fbf606cb23f2e0f9b0746b697c8355c11078c4a https://github.com/wkoszek/mini_printf/commit/1fbf606cb23f2e...
- deleted 11y ago[deleted]