4 ms·
Isn't the fact that core types don't have a fixed representation a bigger mistake ? a char can be 16 bits, for example, aso.
by toolslive 8y ago
Isn't the fact that core types don't have a fixed representation a bigger mistake ?
a char can be 16 bits, for example, aso.
- WalterBright 8y agoThe unfixed type sizes are mostly just a nuisance, though I've wasted a lot of time dealing with them.
- p0nce 8y agoIt can also create untold naming conflicts.
- flingo 8y agoWhen can a char be 16 bits? I presume it'd still have a sizeof() of 1 though.
- toolslive 8y agoTexas Instruments C54x DSPs It can even be funkier, like 12 bits in a char https://stackoverflow.com/questions/2098149/what-platforms-have-something-other-than-8-bit-char https://stackoverflow.com/questions/2098149/what-platforms-h... It's a mess
- WalterBright 8y agoI've seen 32 bit chars on some DSP C implementations.
- jibal 8y ago"When can a char be 16 bits?" Whenever an implementation says so. There are now few machines where the addressable unit is not 8 bits though, which is why languages like D and Java can get away with not supporting them. > I presume it'd still have a sizeof() of 1 though. The language standard requires that.
- hcs 8y agoAlso char not specified in the language as signed or unsigned...
- jibal 8y ago"Isn't the fact that core types don't have a fixed representation a bigger mistake ? " No. There were problems when 64-bit CPUs came along, but they have been pretty much ironed out, and don't nearly compare to the pervasive bugs that Walter mentions in his article.