Kanbaru 🌟 (one hikari of too many)
on x64 Linux, uint64_t is an alias of unsigned long, but on x64 macOS, uint64_t is an alias of unsigned long long. this doesn’t matter for C code, but it interacts badly with C++ overload resolution, even though sizeof(long) == sizeof(long long) on both systems. fun!
Kanbaru 🌟 (one hikari of too many)
(replying to Kanbaru 🌟 (one hikari of too many))
long long was a mistake
Kanbaru 🌟 (one hikari of too many)
(replying to Kanbaru 🌟 (one hikari of too many))
…I said “this doesn’t matter for C code”, but the way I tested this was with the _Generic macro (https://godbolt.org/z/v3c4n56jj), which is a C feature. also, you might be using really anal compiler flags…
Kanbaru 🌟 (one hikari of too many)
(replying to Kanbaru 🌟 (one hikari of too many))
ok are you ready for this? my hottest c take
int should be 64-bit on 64-bit platforms
Saagar Jha
(replying to Kanbaru 🌟 (one hikari of too many))
@hikari If you use Swift you can enjoy its ILP64 goodness
Kanbaru 🌟 (one hikari of too many)
(replying to Saagar Jha)
@saagar this is because of NSInteger isn't it? Objective-C is the only good C
Saagar Jha
(replying to Kanbaru 🌟 (one hikari of too many))
@hikari Maybe, but also that ILP64 is typically advantageous for compiler optimizations