Skip to content

Revert deprecation of EMULATE_FUNCTION_POINTER_CASTS #24169

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions site/source/docs/tools_reference/settings_reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -467,9 +467,8 @@ sent value to memory and loaded the received type from the same memory (using
truncs/extends/ reinterprets). This means that when types do not match the
emulated values may not match (this is true of native too, for that matter -
this is all undefined behavior). This approaches appears good enough to
support Python, which is the main use case motivating this feature.

.. note:: This setting is deprecated
support Python (the original motiviation for this feature) and Glib (the
continued motivation).

Default value: false

Expand Down
4 changes: 2 additions & 2 deletions src/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -342,9 +342,9 @@ var SAFE_HEAP_LOG = false;
// truncs/extends/ reinterprets). This means that when types do not match the
// emulated values may not match (this is true of native too, for that matter -
// this is all undefined behavior). This approaches appears good enough to
// support Python, which is the main use case motivating this feature.
// support Python (the original motiviation for this feature) and Glib (the
// continued motivation).
// [link]
// [deprecated]
var EMULATE_FUNCTION_POINTER_CASTS = false;

// Print out exceptions in emscriptened code.
Expand Down
4 changes: 2 additions & 2 deletions test/test_other.py
Original file line number Diff line number Diff line change
Expand Up @@ -5733,7 +5733,7 @@ def test_bad_function_pointer_cast(self, opts, wasm, safe):
if safe:
cmd += ['-sSAFE_HEAP']
if emulate_casts:
cmd += ['-sEMULATE_FUNCTION_POINTER_CASTS', '-Wno-deprecated']
cmd += ['-sEMULATE_FUNCTION_POINTER_CASTS']
if relocatable:
cmd += ['-sRELOCATABLE'] # disables asm-optimized safe heap
print(cmd)
Expand Down Expand Up @@ -12598,7 +12598,7 @@ def test_setjmp_emulated_casts(self):
}
}
''')
self.do_runf('src.c', 'ok\ndone\n', emcc_args=['-Wno-deprecated', '-sEMULATE_FUNCTION_POINTER_CASTS'])
self.do_runf('src.c', 'ok\ndone\n', emcc_args=['-sEMULATE_FUNCTION_POINTER_CASTS'])

def test_no_lto(self):
# This used to fail because settings.LTO didn't reflect `-fno-lto`.
Expand Down
1 change: 0 additions & 1 deletion tools/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@
'CLOSURE_WARNINGS': 'use -Wclosure instead',
'LEGALIZE_JS_FFI': 'to disable JS type legalization use `-sWASM_BIGINT` or `-sSTANDALONE_WASM`',
'ASYNCIFY_EXPORTS': 'please use JSPI_EXPORTS instead',
'EMULATE_FUNCTION_POINTER_CASTS': 'lack of usage',
'MAYBE_WASM2JS': 'lack of usage',
}

Expand Down