tomaka / hlua

Rust library to interface with Lua
MIT License
510 stars 48 forks source link

Fix hundreds of improper_ctypes warnings #72

Closed Ameliorate closed 8 years ago

Ameliorate commented 8 years ago

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.

tomaka commented 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.

Ameliorate commented 8 years ago

You do have a point. The issue could also be fixed by having a

![allow(improper_ctypes)] on the module root.

TyOverby commented 8 years ago

@Ameliorate Or a #[allow(improper_ctypes)] on the struct itself.