3 ms·
It's not as unlikely as you think. Use your imagination. I seem to recall some late 90s Unix where size_t was 32 bits and pointers were 64 bits. I think it was
by asveikau 8y ago
It's not as unlikely as you think. Use your imagination.
I seem to recall some late 90s Unix where size_t was 32 bits and pointers were 64 bits. I think it was Tru64? Seems to be backed up here: http://www.cecalc.ula.ve/documentacion/tutoriales/COMPAQC/DOCU0016.HTM http://www.cecalc.ula.ve/documentacion/tutoriales/COMPAQC/DO... In Compaq C, size_t is unsigned int .
On 16 bit x86 it certainly is most natural to have size_t be 16 bits but full addressable memory is 1mb.
Again, if there were no ambiguity here there would be no need to introduce a new typedef, but they did, in 1999.
- ajross 8y agoI'll grant the Alpha point, which seems like a clear and unfortunate bug. But the DOS one is wrong. "Addressible" memory with segmentation may be 20 bits, but the maximum size of an object that can be referenced through any pointer is 65536 bytes. It was possible to compile in a "huge mode" where all pointers were expressed as base/offset, but in fact there the size_t was a compiler-generated 32 bit type.