The codebase I'm porting to WebAssembly is mostly C, rather than C++, and
parts of it are decades old. I'm having to clean up places where it gets
clever with function calling, to get rid of function signature mismatches.

I'm currently using the emcc option -Werror=cast-function-type to find them
at compile time. However, this is stricter than WebAssembly
apparently requires: I've been given to understand that the arguments all
get smushed down to i32, i64, f32 or f64, with pointers being passed as
the appropriate i-type. Structs are passed by pointer.

Would it be possible to add a Clang warning (configurable as an error) that
was looser than -Werror=cast-function-type and just matched to the
strictness that WebAssembly requires?

If we had that, it could be turned on automatically when targeting
WebAssembly, which would be convenient for people starting on WebAssembly
work.

Thanks,

John Dallman

-- 
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 [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/emscripten-discuss/CAH1xqg%3DYW7bB6pGG_XoUffRdkzGfN296oMvpfcqsNhvs-zu2Lw%40mail.gmail.com.

Reply via email to