Проясните, пожалуйста, пункт стандарта 6.5/7:
An object shall have its stored value accessed only by an lvalue expression that has one of the following types:
...
— an aggregate or union type that includes one of the aforementioned types among its members (including, recursively, a member of a subaggregate or contained union)
1.
struct A;
struct B;
void f(struct A *a, struct B *b)
{
assert(a == b);
}
Не для этого ли случая нужен атрибут may_alias?
2.
struct A { int a; }
struct B { int b; struct A a; }
void f(struct A *a, struct B *b);