Closed Ameliorate closed 8 years ago
The struct is only ever accessed by pointer, so in theory it's not a problem if it's zero-sized. I'm not sure if your PR is the right fix to these warnings.
You do have a point. The issue could also be fixed by having a
@Ameliorate Or a #[allow(improper_ctypes)]
on the struct itself.
This does it by adding a 8 bit padding value to the lua_State struct.
These warnings, however, are still correct. The C spec does not account for zero sized structs. In C, structs that are empty still take up space, for the reason that two different variables will always have different addresses.