次のコードを検討してください。
struct blah {
int x;
int y;
};
struct foo {
union {
struct {
struct blah *b;
};
};
};
int main()
{
struct foo f;
struct blah *b;
// Warning on below assignment
b = &f.b;
return 0;
}
assignment from incompatible pointer type
LHS と RHS の両方が同じタイプ (明らかに) であるにもかかわらず、GCC が警告を生成するのはなぜですか? struct blah
IOW、がネストされていると何が変わるのstruct foo
ですか?
ここに有効な警告がある場合、それは何ですか?