2 ms·
That's not true, it is merely true on most ABIs. The only case where C really erases this information is casting to uintptr_t and back.
by astrange 3y ago
That's not true, it is merely true on most ABIs. The only case where C really erases this information is casting to uintptr_t and back.
- Gibbon1 3y agogcc also has some builtins to check pointer sizes when the compiler is able to figure it out. https://gcc.gnu.org/onlinedocs/gcc-4.1.2/gcc/Object-Size-Checking.html https://gcc.gnu.org/onlinedocs/gcc-4.1.2/gcc/Object-Size-Che... Which is why I harp on the idea that the real problem is the gold bricks on WG14 who are intentionally blocking improvements to make C safer. Also point out that if you can implement C on 16bit 0x86's segmented architecture you can certainly implement C with phat pointers too.
- pjmlp 3y agoUnless it is clearly specified on the ISO C standard, it is true in practice, and something that is impossible to rely on.