From: Ian Campbell Subject: Re: [PATCH v6 3/5] xen: arm: include public/xen.h in foreign interface checking Date: Thu, 8 Aug 2013 09:38:47 +0100 Message-ID: <1375951127.619.68.camel@kazak.uk.xensource.com> References: <1374234595.13645.59.camel@kazak.uk.xensource.com> <1374234671-6547-3-git-send-email-ian.campbell@citrix.com> <20994.27754.237516.509457@mariner.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20994.27754.237516.509457@mariner.uk.xensource.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: Ian Jackson Cc: keir@xen.org, stefano.stabellini@eu.citrix.com, tim@xen.org, xen-devel@lists.xen.org, julien.grall@citrix.com, Jan Beulich List-Id: xen-devel@lists.xenproject.org On Wed, 2013-08-07 at 16:48 +0100, Ian Jackson wrote: > Ian Campbell writes ("[Xen-devel] [PATCH v6 3/5] xen: arm: include public/xen.h in foreign interface checking"): > > mkheader.py doesn't cope with > > struct foo { }; > > so add a newline. > > > > Define unsigned long and long to a non-existent type on ARM so as to catch > > their use. > > > > Teach mkheader.py to cope with structs which are ifdef'd. > ... > > #ifdef XEN_HAVE_PV_GUEST_ENTRY > > -#define MAX_GUEST_CMDLINE 1024 > ... > > +#define MAX_GUEST_CMDLINE 1024 > > Is this deliberate ? IIRC the magic in mkheader.py requires #ifdef FOO struct ... and cannot cope with #ifdef FOO #define BAR struct ... I could make the regex more complicated to cope with this case but just moving the #define next to its only usage seemed simpler. The regex has other shortcomings like only dealing with a single struct per ifdef and such. I think regex lacks the expressive power to fix this and I don't much fancy rewriting this script in something more capable. > It's not mentioned in the commit message AFAICT. I rewrote the final line of the changelog to be: Teach mkheader.py to cope with structs which are ifdef'd. This cannot cope with #defines between the #ifdef and the struct definitions, so move MAX_GUEST_CMDLINE to be next to its only usage. Does that suffice? Ian.