On 07/13/09 17:36, Paul Brook wrote: >> The second helps a bunch of helper macros to help creating property >> declarations and converts pci.c as example. I'm not that happy with >> that one yet. Especially I'd like to check somehow that >> typeof(_state->_field) == _type. But couldn't figure out a way to do >> so. As we are setting up static data structures we are quite limited in >> what we can do here. The typechecking trick used by the linux kernel >> min/max macros can't be used for example. > > Could we use a union rather than an opaque pointer for the default value? See patch (not functional, just to show the macros). Improves things only a little bit. We still don't have any type checking for the struct element we are writing to. We have the field offset and the type it is supposed to be. But no actual check. cheers, Gerd