@amonakov Not specific to your example, but yes compatibility of structs is non transitive. We intentionally make use of something like this in the musl c11 thread primitives IIRC, to reuse pthread ones:
https://git.musl-libc.org/cgit/musl/commit/?id=b7cf71a190813590860af25b32532b6c360ac502