This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: C ABI: struct/union inconsistency
On Fri, Sep 27, 2002 at 11:52:46AM -0700, Mark Mitchell wrote:
> My point was that I would like a header file that looks like:
>
> extern "C" {
> struct S {};
> ...
> }
>
> to have the same meaning in both languages; that's not possible if S has
> size zero in C.
It's also not possible if one writes
extern "C" {
struct S {
const int i;
};
}
as they have different meanings in C and C++. So I don't see that your
point necessarily holds. The fact of the matter is that the two languages
do not line up 100%, and one has to live with it.
I'll ask some kernel developers what they think of this issue, but I
suspect that they'll be in favour of the status quo, and I'll have a
hard time arguing against that "merely" for compatibility with C++.
r~