On 09/29/2013 10:17 PM, Jonathan Cameron wrote: > On 09/29/13 19:56, Lars-Peter Clausen wrote: >> I think a transparent union should work nicely and doesn't cause any code >> churn. Maybe even with a direct pointer to the event_spec. >> >> Something like: >> >> struct iio_dev_attr { >> ... >> union { >> u64 address; >> struct { >> struct iio_event_spec *spec; >> enum iio_event_info info; >> } event; >> }; >> ... >> }; > Looks good to me. There is a bug[1] in gcc < 4.6 that breaks this for static struct initializers. E.g. static struct iio_dev_attr attr = { ... .address = 123, ... }; wont work. So I guess this means we can't use it for now. - Lars [1] http://gcc.gnu.org/bugzilla/show_bug.cgi?id=10676 -- To unsubscribe from this list: send the line "unsubscribe linux-iio" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html