From: Ian Jackson Subject: Re: [PATCH v2-resend 02/30] libxl: idl: allow KeyedUnion members to be empty Date: Tue, 27 Aug 2013 15:53:22 +0100 Message-ID: <21020.48482.317438.509457@mariner.uk.xensource.com> References: <1377168678-25492-1-git-send-email-rob.hoes@citrix.com> <1377168678-25492-3-git-send-email-rob.hoes@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1377168678-25492-3-git-send-email-rob.hoes@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Rob Hoes Cc: ian.campbell@citrix.com, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org Rob Hoes writes ("[Xen-devel] [PATCH v2-resend 02/30] libxl: idl: allow KeyedUnion members to be empty"): > This is useful when the key enum has an "invalid" option and avoids > the need to declare a dummy struct. Use this for domain_build_info > resulting in the generated API changing like so: > --- tools/libxl/_libxl_BACKUP_types.h > +++ tools/libxl/_libxl_types.h > @@ -377,8 +377,6 @@ typedef struct libxl_domain_build_info { > const char * features; > libxl_defbool e820_host; > } pv; > - struct { > - } invalid; > } u; I assume that the problem here is that the compiler rejects the empty struct. > - ("invalid", Struct(None, [])), > + ("invalid", None), Is it really necessary to do this with a special-cased new "None" type rather than just fixing the empty structs by putting a dummy member in them ? Ian.