You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Avoid exporting/defining main when we try to detect an unexported main (#20971)
In debug builds we attempt to detect and unexported main by adding it to
EXPORT_IF_DEFINED, but then ignoring it. However we were not fully
ignoring it which resulted in `main` getting run in debug builds but not
in release builds.
warning = 'emcc: warning: `main` is defined in the input files, but `_main` is not in `EXPORTED_FUNCTIONS`, which means it may be eliminated as dead code. Export it if you want `main` to run. [-Wunused-main]'
7926
+
@parameterized({
7927
+
'': ([],),
7928
+
'O2': (['-O2'],),
7929
+
})
7930
+
def test_warn_unexported_main(self, args):
7931
+
warning = 'emcc: warning: `main` is defined in the input files, but `_main` is not in `EXPORTED_FUNCTIONS`. Add it to this list if you want `main` to run. [-Wunused-main]'
diagnostics.warning('unused-main', '`main` is defined in the input files, but `_main` is not in `EXPORTED_FUNCTIONS`, which means it may be eliminated as dead code. Export it if you want `main` to run.')
578
+
diagnostics.warning('unused-main', '`main` is defined in the input files, but `_main` is not in `EXPORTED_FUNCTIONS`. Add it to this list if you want `main` to run.')
0 commit comments