Closed detly closed 3 years ago
When a union is nested inside another union, it must be enclosed in a struct so that its "which" member is not overlapping with its other members.
Schema in question:
struct A { union { zero @0 :Void; one :union { first @1 :Void; second @2 :UInt16; } } }
C code showing bug:
struct A { enum A_which which; capnp_nowarn union { enum A_one_which one_which; capnp_nowarn union { uint16_t second; } one; }; };
Correct C code:
struct A { enum A_which which; capnp_nowarn union { capnp_nowarn struct { enum A_one_which which; capnp_nowarn union { uint16_t second; }; } one; }; };
Fixes #43.
When a union is nested inside another union, it must be enclosed in a struct so that its "which" member is not overlapping with its other members.
Schema in question:
C code showing bug:
Correct C code:
Fixes #43.