Blocklist max_align_t from bindings generation
#1401
Merged
+8
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Bindgen can generate wrong size checks for types defined as
__attribute__((aligned(__alignof__(struct {...})))), which is, for example, how clang defines max_align_t: https://clang.llvm.org/doxygen/____stddef__max__align__t_8h_source.html. Size checks seems to be fine on all the targets butwasm32-unknown-emscripten, disallowing web builds.Outside the size check, the generated max_align_t seemed to be OK - llvm defines long double as 128 bits long (u128/f128) for wasm32.
We don't use
max_align_tanywhere, so blacklisting it until upstream fixes the problem seems to be the most sane solution.The
max_align_tis being included because of#include <cstddef>in gdextension_interface.h: https://github.com/godotengine/godot/blob/master/core/extension/gdextension_interface.h#L44Upstream issue: rust-lang/rust-bindgen#3295
Before 0.70 bindgen wasn't generating compile-time checks and relied on tests instead (which were never ran):
Generated binding to max_align_t with bindgen 0.69
Same for bindgen >= 0.7
I also updated bindgen – I was already poking their code, so I would (hopefully) notice any regression or change in their API.