Exports from imported but unused files are missing (opens in new tab)
While playing with WebAssembly, I noticed that if I export a function in a file (called b.zig), and I import this file from my main file (called a.zig), then the function from b.zig is exported only if I use some other things from b.zig. I made a minimal example here : a.zig b.zig The compilation gave me as WASM file. If the manual export is commented or not, I get this from wasm-objdump -x: without_manual_export.wasm with_manual_export.wasm You can see that in the first case there is no valu...
Read the original article