From: David Gibson <david@gibson.dropbear.id.au>
To: ccan@lists.ozlabs.org
Subject: Re: [PATCH 0/4] Replace TCON() with TCON_WRAP()
Date: Thu, 27 Jul 2017 17:27:48 +1000 [thread overview]
Message-ID: <20170727072748.GD7970@umbus.fritz.box> (raw)
In-Reply-To: <20170723122907.10686-1-david@gibson.dropbear.id.au>
[-- Attachment #1.1: Type: text/plain, Size: 1855 bytes --]
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
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
[-- Attachment #2: Type: text/plain, Size: 127 bytes --]
_______________________________________________
ccan mailing list
ccan@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/ccan
prev parent reply other threads:[~2017-07-27 10:51 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-23 12:29 [PATCH 0/4] Replace TCON() with TCON_WRAP() David Gibson
2017-07-23 12:29 ` [PATCH 1/4] tlist: Use TCON_WRAP instead of TCON David Gibson
2017-07-23 12:29 ` [PATCH 2/4] jset: " David Gibson
2017-07-31 6:25 ` Rusty Russell
2017-08-01 5:17 ` David Gibson
2017-07-23 12:29 ` [PATCH 3/4] jmap: " David Gibson
2017-07-23 12:29 ` [PATCH 4/4] objset: " David Gibson
2017-07-27 7:27 ` David Gibson [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170727072748.GD7970@umbus.fritz.box \
--to=david@gibson.dropbear.id.au \
--cc=ccan@lists.ozlabs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).