3 ms·
> NULL is not guaranteed to be the stored as zeros Is that a real issue, though? > padding is going to make your life annoying Just memset?
by nsajko 6y ago
> NULL is not guaranteed to be the stored as zeros
Is that a real issue, though?
> padding is going to make your life annoying
Just memset?
- huhtenberg 6y ago>> NULL is not guaranteed to be the stored as zeros > Is that a real issue, though? Of course, it's not, but that's one of those factoids that everyone learns at some point and feels like needing to rub it into everyone else's face assuming that these poor schmucks are as oblivious to it as they once were. A circle of life and all that.
- saagarjha 6y agoForgive me for encouraging the adoption of portable, compliant code to those who may not otherwise be aware of it. If you want to assume all the world’s an x86 that’s great but you should at least know what part of your code is going to be wrong elsewhere.
- huhtenberg 6y agoName a single platform where NULL is not 0.
- tjalfi 6y agoAMD GPUs use a non-zero NULL pointer[0]. [0] https://reviews.llvm.org/D26196 https://reviews.llvm.org/D26196
- nsajko 6y agoInteresting. And it isn't even always non-zero; sometimes it's 32-bit -1, sometimes it's 32-bit 0 and sometimes it's 64-bit 0: https://llvm.org/docs/AMDGPUUsage.html#address-spaces https://llvm.org/docs/AMDGPUUsage.html#address-spaces