5 ms·
There isn't a guarantee that NULL has a bit pattern that's the same as a true (void)0 C-style null pointer either. I didn't look it up directly but apparently
by ben0x539 10y ago
There isn't a guarantee that NULL has a bit pattern that's the same as a true (void)0 C-style null pointer either.
I didn't look it up directly but apparently NULL is allowed to be nullptr instead of 0, and nullptr converts to void in varargs arguments.
I think C/C++ also allow actual null pointers to have different bit patterns than the integer zero, so in C++03 passing NULL to terminate a varargs argument list would technically be incorrect, or maybe implementation-defined.
- CJefferson 10y agoDamn, there is a special exception in the definition of vararg functions, just for nullptr! throws things in the air I give up having discussions about C++.
- ben0x539 10y agoI give up too, because the HN formatting is actively fighting me.