Re:Using signed or unsigned int by default in C (2015)
by coding123 on Tuesday August 23, 2022 @01:32PM
(#32568241)
use longs because it's not arch dependent
[ Parent
| on HN ]
Re:Using signed or unsigned int by default in C (2015)
by xdavidliu on Tuesday August 23, 2022 @01:49PM
(#32568503)
long in C and C++ is absolutely arch dependent. In Java it's not depedendent, but neither are any of the other primitives in Java.
Re:Using signed or unsigned int by default in C (2015)
by messe on Tuesday August 23, 2022 @02:21PM
(#32568964)
long is definitely arch dependent.
It’s even operating system dependent:
It’s 32-bits on 32-bit x86 unix-likes and windows, as well as 32-bit on 64-bit windows.
On 64-bit unix-likes it’s 64-bit.
Embedded is so varied (and generally 16 or 32 bit), that I’m not even go to hazard a guess on the distribution there.