I have a lot of code that stores pointers to functions as void* and then casts them back to the "correct" type. This is part of a LISP interpreter that is embedded in my product's test harness, and used to write test scripts.This works in conventional C, but I'm having trouble with it in WebAssembly. I've found that functions with and without argument lists don't match, which is quite reasonable, but I'm having trouble getting a fix to work.Just how identical do the function signatures have to be?
- Character-for-character identical?
- Identical types with different names are OK?
- Static and non-static functions with otherwise identical signatures are OK?
- Something else?
--
You received this message because you are subscribed to the Google Groups "emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-disc...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/emscripten-discuss/CAL_va28ocNLCKKvbomaW2Ci5Asf70uyqis0vKADYBW1XDe0x1A%40mail.gmail.com.
On Wed, Nov 26, 2025 at 9:06 PM 'Sam Clegg' via emscripten-discuss <emscripte...@googlegroups.com> wrote:> Function signatures need to be an exact match at the Wasm level. At the wasm level> signatures are made of only the core i32, i64, f32, f64 types, so its likely the many different> C signatures have the same Wasm signature.OK, I presume pointers are i32 or i64, according to if you're building for 32-bit or 64-bit Wasm?
To view this discussion visit https://groups.google.com/d/msgid/emscripten-discuss/CAH1xqgmsPcWmJk3TTjfe-S6gj%3Dyt4EwVu5KZTyfFgvgnP6Viag%40mail.gmail.com.