tcon: Encode information on container members in "type" canaries
authorDavid Gibson <>
Tue, 20 Oct 2015 02:18:17 +0000 (13:18 +1100)
committerDavid Gibson <>
Sun, 25 Oct 2015 12:32:44 +0000 (23:32 +1100)
tcon: Encode information on container members in "type" canaries

Add "container canaries" to tcon.  This allows information about a specific
member of a container structure to be encoded with TCON or TCON_WRAP.  Once
that's done, tcon_container_of() and tcon_member_of() can be used to
translate between member and container pointers based on the canary
information, without having to repeat the type and member details.

Signed-off-by: David Gibson <>
ccan/tcon/test/compile_fail-container1.c [new file with mode: 0644]
ccan/tcon/test/compile_fail-container1w.c [new file with mode: 0644]
ccan/tcon/test/compile_fail-container2.c [new file with mode: 0644]
ccan/tcon/test/compile_fail-container2w.c [new file with mode: 0644]
ccan/tcon/test/compile_fail-container3.c [new file with mode: 0644]
ccan/tcon/test/compile_fail-container3w.c [new file with mode: 0644]
ccan/tcon/test/compile_fail-container4.c [new file with mode: 0644]
ccan/tcon/test/compile_fail-container4w.c [new file with mode: 0644]
ccan/tcon/test/run-container.c [new file with mode: 0644]