Skip to content
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

Fix issue where the use of a function pointer cast can trip -fsanitize=undefined on recent versions of clang #1211

Merged
merged 1 commit into from
Jul 11, 2024

Conversation

darkuranium
Copy link
Contributor

@darkuranium darkuranium commented May 28, 2024

Note: The changes were made against v3.11.2, not master. Hopefully they'll be useful anyway.


The error in question: (plus others, for each case of a casted dtor function pointer)

<...>/flecs/src/bootstrap.c:142:8: runtime error: call to function flecs_observer_fini through pointer to incorrect function type 'void (*)(void *)'
<...>/flecs/src/observer.c:1017: note: flecs_observer_fini defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior <...>/flecs/src/bootstrap.c:142:8 

@SanderMertens
Copy link
Owner

Thanks for the PR!

@SanderMertens SanderMertens merged commit 0476392 into SanderMertens:master Jul 11, 2024
59 of 69 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants