Emilio Cobos Álvarez
Emilio Cobos Álvarez
From the point of view of the compiler, `!(callback_or_null as *mut c_void).is_null()` will always be true. Passing `NULL` to that function from C is undefined behavior.
Yeah, we could do that potentially, though AIUI rustc still doesn't make mutable references `noalias`... I don't think it'd be controversial to put this behind a flag if wanted. A...
We should probably switch C++ bindings to use `std::array` and let them implement operator==... Or another route would just be memcmp'ing or something.
> Would there be a way to tune the cargo metadata operation to avoid the possible need to hit the network? You can pass a metadata file to cbindgen already,...
I think the define shenanigans is the only way to deal with that right now. You could run the preprocessor on the output to clean it up I guess, or...
Yeah, I'd expect that to work. We should probably dig a bit where stuff is going wrong.
We need to check which assembly does rust generate for this, but yeah, one way or the other this is a bug.
So... CString is not supposed to work, because it's not ABI-compatible, but we should add it to the opaque type list here: https://github.com/eqrion/cbindgen/blob/ccd1f0e9ec2369735b9481c85057b9c65b6b0908/src/bindgen/parser.rs#L430-L460 so that you can pass them by...
Can you attach or link to a test-case that reproduces the issue? cbindgen doesn't output rerun-if-changed so I don't know where those are coming from.
Yeah, this shouldn't be terrible to add I think, wanna give it a shot? I'm happy to help out. Seems like generating a `const uint8_t[]` should be the most straight-forward...