MochiLibraries / Biohazrd

A framework for automatically generating binding wrappers for C/C++ libraries
MIT License
60 stars 9 forks source link

Add warning when unmitigated `bool` or `char` appears in function pointers. #101

Closed PathogenDavid closed 2 years ago

PathogenDavid commented 3 years ago

https://github.com/InfectedLibraries/Biohazrd/issues/99 introduced a workaround for correctness bugs which arise when a bool or char is used in the context of an unmanaged function pointer.

However if the transformation is omitted for whatever reason we will end up emitting incorrect interop code with subtle and frustrating bugs. We should add a verification to suggest running this transformation if any of these problematic types exist.

PathogenDavid commented 3 years ago

Semi-related: https://github.com/InfectedLibraries/Biohazrd/issues/100

PathogenDavid commented 2 years ago

This was made unnecessary by https://github.com/MochiLibraries/Biohazrd/issues/236 as we convert bool/char to NativeBoolean/NativeChar just in time during emit.