Closed joshtriplett closed 2 years ago
Thanks for reporting, hmm, this is kinda difficult. So we have a similar issue that bindgen has, a simple fix would be reverting #24 and just allowing the lint but it's not ideal. Do you have any clue about this?
I think there's a standard incantation for offset_of that doesn't use zeroed
.
Thanks! Unfortunately we cannot use an external crate but the snippet there seems useful.
The fix for #23 (in PR #24) calls
mem::zeroed()
to create a zero-initialized version of a structure. However, not all structures can be safely zero-initialized.I discovered this when attempting to update
libz-sys
to ctest2 0.4.3 to get the fix for #23. One of the structures contained function pointers, which couldn't be zero-initialized, and this resulted in a pile of warnings as well as a runtime panic.