• David Gibson's avatar
    strmap: Convert to using TCON_WRAP() instead of plain TCON() · ab244401
    David Gibson authored
    The usual way of construction strmap objects is to use the STRMAP_MEMBERS()
    macro which expands to both a raw strmap structure and a tcon type canary.
    However, the tcon type canary involves a flexible array member which means
    that in standard C99 STRMAP_MEMBERS() must appear only at the end of a
    structure definition.  But worse, that structure can then only appear at
    the end of any other structure it is included in, which is pretty
    inconvenient for the intended purpose of creating type specific strmaps.
    
    gcc extensions allow this to work (somehow), but clang complains loudly
    about it.
    
    The tcon module already includes the TCON_WRAP() mechanism, which already
    provides this same sort of type-specific definitions in a more general way.
    So convert strmap (and its users) to that approach.
    
    This removes STRMAP_MEMBERS() entirely, breaking compatibility.  I'm hoping
    strmap is used in few enough places that we can get away with that.
    Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
    ab244401
ccanlint.c 17.4 KB