On Sun, Jul 23, 2017 at 10:29:03PM +1000, David Gibson wrote: > ccan/tcon has two basic ways to be used. With TCON() which adds a > type canary to a user's existing structure, or with TCON_WRAP(), which > wraps a user's structure creating a new structure with the canaries. > > TCON() is older and has several modules already using it. > Unfortunately, it uses flexible-array members which aren't allowed in > the middle of structures, except as a gcc extension. That means with > a "normal" compiler TCON() invocations can only appear at the end of a > structure. More importantly it also means a structure including them > can never be embedded in another structure except at the end. > > In short, using TCON() is either non-portable, or badly violates > principle of least surprise. So, this series removes use of it from > all existing ccan modules.
Rusty, any thoughts on this? Unless there's an objection, I'm inclined to commit it. > David Gibson (4): > tlist: Use TCON_WRAP instead of TCON > jset: Use TCON_WRAP instead of TCON > jmap: Use TCON_WRAP instead of TCON > objset: Use TCON_WRAP instead of TCON > > ccan/jmap/jmap.h | 59 > +++++++++++++++++++++++++++++---------------------- > ccan/jmap/test/run.c | 8 +++---- > ccan/jset/jset.h | 45 ++++++++++++++++++++++++--------------- > ccan/jset/test/run.c | 9 ++++---- > ccan/objset/objset.h | 31 +++++++++++++++------------ > ccan/tlist/_info | 6 +----- > ccan/tlist/test/run.c | 24 ++++++++++----------- > ccan/tlist/tlist.h | 25 +++++++++++----------- > 8 files changed, 114 insertions(+), 93 deletions(-) > -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson
signature.asc
Description: PGP signature
_______________________________________________ ccan mailing list ccan@lists.ozlabs.org https://lists.ozlabs.org/listinfo/ccan