From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: [PATCH for-4.6] xen/public: arm: Use __typeof__ rather than typeof Date: Wed, 7 Oct 2015 09:28:18 +0100 Message-ID: <1444206498.5302.259.camel@citrix.com> References: <1443986642-24392-1-git-send-email-julien.grall@citrix.com> <56126D8702000078000A80AC@prv-mh.provo.novell.com> <561403EF.3000901@citrix.com> <5614D86302000078000A8D8E@prv-mh.provo.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1ZjkEw-0002eW-Eg for xen-devel@lists.xenproject.org; Wed, 07 Oct 2015 08:38:22 +0000 In-Reply-To: <5614D86302000078000A8D8E@prv-mh.provo.novell.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: Jan Beulich , Julien Grall Cc: Ian Jackson , Tim Deegan , Keir Fraser , Wei.Liu2@citrix.com, xen-devel@lists.xenproject.org List-Id: xen-devel@lists.xenproject.org On Wed, 2015-10-07 at 00:31 -0600, Jan Beulich wrote: > > > > On 06.10.15 at 19:25, wrote: > > On 05/10/15 11:31, Jan Beulich wrote: > > > > > > On 04.10.15 at 21:24, wrote: > > > > The keyword typeof is not portable: > > > > > > > > /usr/src/freebsd/sys/xen/hypervisor.h:93:2: error: implicit > > > > declaration > > > > of function 'typeof' is invalid in C99 > > > > [-Werror,-Wimplicit-function-declaration] > > > > > > Actually, it's worse than that - typeof() is a gcc extension, and we > > > shouldn't use extensions in public headers without at least having > > > alternative code for not gcc compatible compilers in place. In fact > > > we should probably aim at removing the exclusion of public/arch-% > > > in the ANSI conformance check; IIRC I had to add it because things > > > wouldn't build without, but with the (then forgotten) goal of dealing > > > with this properly later on. > > > > I don't see how header.chk would have catch my issue. The problem is in > > the macro set_xen_guest_handle_raw which is not used within the headers > > (except by set_xen_guest_handle which is not used at all). > > > > It may be worth to add a dummy .c which call the macros to check they > > are ANSI compliant. > > Hmm, true, conformance of macros isn't being checked right now > (i.e. we only verify that the header as such compiles, not that > everything in the header can be used). A manually created source > would help only to some degree, as it would need to be kept up to > date with future additions. I.e. the long term solution probably > ought to be an at least partially machine generated source file It ought to be possible to at least automatically check that every #define ([A-Za-z_]+) is matched by a corresponding $1 in the .c file. > . I added this to my todo list (but towards the end of it). FWIW I have a similar issue with the headers checks for my split up libxenctrl stable libraries series, and it is in a similar place on my todo list... Ian.