Re:Writing a C compiler in 500 lines of Python
by foldr on Tuesday September 05, 2023 @06:58AM
(#37390146)
Fair point. I guess the issue is with library code that uses int. But you aren't typically going to use lots of general-purpose library code if you're targeting a microcontroller.
[ Parent
| on HN ]
Re:Writing a C compiler in 500 lines of Python
by circuit10 on Tuesday September 05, 2023 @11:31AM
(#37393064)
If that library code doesn’t use the smaller types then it probably isn’t designed for those platforms, which means it won’t be tested with the smaller int types and they will likely cause lots of bugs. The one advantage I do see is that it might avoid extra sign extension instructions on some architectures when working with less than the native size, but there’s int_fast16_t for that