5 ms·
It’s added to the standard because macro version has undefined behavior. (yet it still works on any compiler without a problem)
by annilt 6y ago
It’s added to the standard because macro version has undefined behavior. (yet it still works on any compiler without a problem)
- londons_explore 6y agoI was about to ask if it was legal to dereference a null pointer and then take the address of it... I presume it is not, but I'm surprised compilers don't complain at compilation time.
- saagarjha 6y agoDereferencing a null pointer and then immediately "undoing" it by taking its address is actually legal, I believe. I think the undefined behavior here is the member access instead of the magic sequence &* which is supposed to cancel out.