From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH for-4.6] xen/public: arm: Use __typeof__ rather than typeof Date: Tue, 6 Oct 2015 18:25:03 +0100 Message-ID: <561403EF.3000901@citrix.com> References: <1443986642-24392-1-git-send-email-julien.grall@citrix.com> <56126D8702000078000A80AC@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 1ZjW0T-0002od-J0 for xen-devel@lists.xenproject.org; Tue, 06 Oct 2015 17:26:29 +0000 In-Reply-To: <56126D8702000078000A80AC@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 Cc: Keir Fraser , ian.campbell@citrix.com, Tim Deegan , Ian Jackson , xen-devel@lists.xenproject.org, Wei.Liu2@citrix.com List-Id: xen-devel@lists.xenproject.org Hi Jan, 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. Regards, -- Julien Grall