[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH for-4.6] xen/public: arm: Use __typeof__ rather than typeof



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 <julien.grall@xxxxxxxxxx>
> 
> ---
> Cc: Ian Campbell <ian.campbell@xxxxxxxxxx>
> Cc: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
> Cc: Jan Beulich <jbeulich@xxxxxxxx>
> Cc: Keir Fraser <keir@xxxxxxx>
> Cc: Tim Deegan <tim@xxxxxxx>
> 
>     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

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.