Skip to content
Snippets Groups Projects
Commit 61c4034f authored by Alaric Senat's avatar Alaric Senat Committed by Steve Lhomme
Browse files

mpeg: dvbpsi: avoid casting callbacks

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 [^2].

[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.


[^2]: https://emscripten.org/docs/porting/guidelines/function_pointer_issues.html
parent 837f9778
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment