This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [C++ PATCH] warning about empty extern "C" structures


But not in GNU C:

GCC permits a C structure to have no members:

     struct empty {
     };

 The structure will have size zero.  In C++, empty structures are part
of the language.  G++ treats empty structures as if they had a single
member of type `char'.
Linux kernel, all written in C, has many empty structures. They prevent from introducing safe C++ code.

Roman


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]