From: Wei Liu Subject: Re: [PATCH for-4.6] xen/public: arm: Use __typeof__ rather than typeof Date: Mon, 5 Oct 2015 14:40:39 +0100 Message-ID: <20151005134039.GA32145@zion.uk.xensource.com> References: <1443986642-24392-1-git-send-email-julien.grall@citrix.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 1Zj60T-0005mi-Ee for xen-devel@lists.xenproject.org; Mon, 05 Oct 2015 13:40:45 +0000 Content-Disposition: inline In-Reply-To: <1443986642-24392-1-git-send-email-julien.grall@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: Julien Grall Cc: Wei.Liu2@citrix.com, Keir Fraser , ian.campbell@citrix.com, Tim Deegan , Ian Jackson , Jan Beulich , xen-devel@lists.xenproject.org List-Id: xen-devel@lists.xenproject.org On Sun, Oct 04, 2015 at 08:24:02PM +0100, Julien Grall 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] > > Signed-off-by: Julien Grall > > --- > Cc: Ian Campbell > Cc: Ian Jackson > Cc: Jan Beulich > Cc: Keir Fraser > Cc: Tim Deegan > > This patch is a candidate to backport in Xen 4.6, 4.5 and 4.4. > > It would be nice to get this small fix before Xen 4.6 is released. > Without it, it's not possible to build ARM software including Xen > headers with -std=c99. This patch doesn't fundamentally make the header ISO compliance. And it's a bit too late for 4.6 now. Wei. > --- > xen/include/public/arch-arm.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/xen/include/public/arch-arm.h b/xen/include/public/arch-arm.h > index faad68d..ba3cd42 100644 > --- a/xen/include/public/arch-arm.h > +++ b/xen/include/public/arch-arm.h > @@ -191,7 +191,7 @@ > #define XEN_GUEST_HANDLE_PARAM(name) __guest_handle_ ## name > #define set_xen_guest_handle_raw(hnd, val) \ > do { \ > - typeof(&(hnd)) _sxghr_tmp = &(hnd); \ > + __typeof__(&(hnd)) _sxghr_tmp = &(hnd); \ > _sxghr_tmp->q = 0; \ > _sxghr_tmp->p = val; \ > } while ( 0 ) > -- > 2.1.4