CE-Programming / toolchain

Toolchain and libraries for C/C++ programming on the TI-84+ CE calculator series
https://ce-programming.github.io/toolchain/index.html
GNU Lesser General Public License v3.0
505 stars 54 forks source link

int_least24_t and int_fast24_t #503

Closed ZERICO2005 closed 5 hours ago

ZERICO2005 commented 6 hours ago

It would be nice to have int_least24_t, int_fast24_t, and 48bit equivalents available in stdint.h. While they would be useless on the eZ80 ti84ce, they would be helpful when porting code from the CE to Windows/Linux.

Some bugs arise from using _BitInt(24) as int24_t when porting code. Having int_least24_t and int_fast24_t would indicate that the code isn't dependent on the integer being exactly 24bits, which can reduce the amount of testing/validation needed.

calc84maniac commented 5 hours ago

Well, there's kind of a problem because these aren't defined in any other stdint.h headers. So you would have to detect whether you're building for CE and typedef them if not, and at that point you can just typedef the CE versions yourself.

mateoconlechuga commented 5 hours ago

Also I'd like to point out if you're porting something, then you're already modifying the code, so having things in a standard header doesn't help much, and might make things worse.