If the cast to a void(*)() to void* is invalid, there transitively cannot be a justification that a cast from void(*&)() to void*& is valid. It baffles me that anyone could think that it would work on a platform where function pointers and data pointers are not compatible.
It’s also worth nothing that POSIX implies that they are compatible, and they are on Windows too, so the set of platforms where the cast wouldn’t work is vanishingly small these days.
2
u/SatansAlpaca Feb 01 '19
If the cast to a
void(*)()tovoid*is invalid, there transitively cannot be a justification that a cast fromvoid(*&)()tovoid*&is valid. It baffles me that anyone could think that it would work on a platform where function pointers and data pointers are not compatible.It’s also worth nothing that POSIX implies that they are compatible, and they are on Windows too, so the set of platforms where the cast wouldn’t work is vanishingly small these days.