3 ms·
Re functions pointers, how does Emscripten gurantee the POSIX behavior that you can roundtrip function pointers to void*?
by gpderetta 8y ago
Re functions pointers, how does Emscripten gurantee the POSIX behavior that you can roundtrip function pointers to void*?
- rcxdude 8y agoSo 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.
- leni536 8y agoDoes Emscripten aim to be POSIX compliant?
- gpderetta 8y agoI hope so if it want to have any chance to support most software out there.