Skip to content

mpeg: dvbpsi: avoid casting callbacks

Alaric Senat requested to merge wasm-strict-function-cast into master

The function signature does not match the dvbpsi callback (demux_t* instead of void*). While this is supported by many platforms and compilers, it's undefined behavior strictly by the standard [1] and it's known to often fail with emscripten 1.

[1]: Section 6.3.2.3, paragraph 8:

A pointer to a function of one type may be converted to a pointer to a function of another type and back again; the result shall compare equal to the original pointer. If a converted pointer is used to call a function whose type is not compatible with the pointed-to type, the behavior is undefined.

Quoting section 6.7.5.1, paragraph 2 for pointer compatibility:

For two pointer types to be compatible, both shall be identically qualified and both shall be pointers to compatible types.

  1. https://emscripten.org/docs/porting/guidelines/function_pointer_issues.html

Merge request reports

Loading