{
"$type": "site.standard.document",
"bskyPostRef": {
"cid": "bafyreihce35z2obqncarrkm2wbkkpuq54qhdrrkibkjp2s6h4hfae43lau",
"uri": "at://did:plc:pi6woz4d47bkuws673w2il2r/app.bsky.feed.post/3mjilau4kshe2"
},
"path": "/t/wasm-warning-return-type-of-main-is-not-int-wmain-return-type/13932#post_1",
"publishedAt": "2026-04-14T21:13:32.000Z",
"site": "https://discourse.haskell.org",
"tags": [
"@Tritlo",
"I reworked the dev env to be Nix flake-based."
],
"textContent": "I forked @Tritlo 's `wasm-game` for the upcoming Ludum Dare 59. I reworked the dev env to be Nix flake-based. It all builds and runs fine..but I get a warning at the C compiler level:\n\n\n /var/folders/17/b_0jqlgs3gx_l0nph13_cbz40000gn/T/nix-shell.u5ayBH/ghc40510_tmp_6_0/ghc_tmp_418_0.c:11:1: error:\n warning: return type of 'main' is not 'int' [-Wmain-return-type]\n 11 | HsJSVal main(void)\n | ^\n |\n 11 | HsJSVal main(void)\n | ^\n\n /var/folders/17/b_0jqlgs3gx_l0nph13_cbz40000gn/T/nix-shell.u5ayBH/ghc40510_tmp_6_0/ghc_tmp_418_0.c:11:1: error:\n note: change return type to 'int'\n 11 | HsJSVal main(void)\n | ^~~~~~~\n | int\n |\n 11 | HsJSVal main(void)\n | ^\n\n 1 warning generated.\n\n\nThe resulting code works..so I don’t think it’s a problem.\n\nI tried telling cabal to ignore it with `cc-options: -Wno-main-return-type` in various ways, but it still happens. Maybe that isn’t getting propagated correctly? (I saw some GH issues about that)\n\nBut it feels like a GHC bug..maybe it is and I should cut GHC gitlab a ticket? But I figured I’d ask the crowd first",
"title": "[wasm] `warning: return type of 'main' is not 'int' ' [-Wmain-return-type]`"
}