// a.c
struct Foo {
int x;
};
// b.c
struct Foo {
int x, y;
};
//d.d
import a;
import b;
static assert(a.Foo.sizeof != b.Foo.sizeof); // Fails
The two structs are assumed to be the same type, size etc. and merged into one instead of iterating over their fields and ensuring all match (in other words, checking for compatibility before assuming they are the same).
Comment #1 by bugzilla — 2023-12-28T04:37:22Z
My excuse is C doesn't check it, either!
Comment #2 by robert.schadek — 2024-12-13T19:24:53Z