[ccan] dgraph, tlist, tcon: MSVC error due to array of flexible structs

David Gibson david at gibson.dropbear.id.au
Wed Sep 28 13:12:40 AEST 2016


On Wed, Sep 28, 2016 at 11:40:43AM +0930, Paul 'Rusty' Russell wrote:
> David Gibson <david at gibson.dropbear.id.au> writes:
> > IIRC, Rusty didn't want to simply replace the tlist module in case
> > there could be subtle brekages in usage.
> 
> BTW, I think this gives us good reason to simply mv tlist2 -> tlist and
> fix up the callers.

Hm.. perhaps.  As noted in another mail, converting dgraph at least to
tlist2 might be a bit ugly.  The two lists it keeps would now have
different types, so it couldn't just keep them as an array, which
might make things less natural in other places.

Maybe any extra switch/ifs will be cancelled out by removing (or
folding into) existing ones.

It would also be possible to make a more minimal conversion of tlist
to TCON_WRAP() which keeps the tlist interface unchanged.

I am thinking we should probably phase out TCON in favour of TCON_WRAP
everywhere - that flexible array member is causing repeated trouble.

Another thing we might want as an interim approach is to add a new
config test for zero-length array members (as opposed to flexible
array members).  TCON could then use those when available and fall
back to the space wasting 1-member array method otherwise.

-- 
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/ccan/attachments/20160928/4aa1121f/attachment.sig>


More information about the ccan mailing list