Closed
Description
The C language does not allow empty structs.
gcc and clang allow them as a language extension, and they have size 0 there. With --pedantic, both will emit a warning on empty C structs.
msvc refuses to compile C code using empty structs.
In C++, empty structs are allowed -- but there, they have size 1!
In rust, a #[repr(C)] unit struct is given size 0. This makes it compatible with gcc and clang in C mode; but has the potential to cause trouble when interfacing with a C++ library.
I think the improper_ctypes lint should issue a warning when #[repr(C)] is applied to a size 0 struct.
Users can suppress the warning when interfacing with C code using the gcc extensions.