2 ms·
So long as you cast it back to the correct type, there isn't any issue. Casting back to a different type is undefined behaviour anyway.
by rcxdude 8y ago
So long as you cast it back to the correct type, there isn't any issue. Casting back to a different type is undefined behaviour anyway.
- gpderetta 8y agoBut this means that two distinct function pointers might compare equal when converted to void*, unless the type is somehow encoded.
- chadaustin 8y agoThis is the first I'm hearing that arbitrary function pointers converted to void* should be distinct on POSIX - do you have a reference?
- gpderetta 8y agoPointers to different objects should not compare equal in C (or at least in C++, can't remember if this is also a rule in C). Then again, functions are not objects.