WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] question regarding gnu-isms

To: Anthony Liguori <aliguori@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: Re: [Xen-devel] question regarding gnu-isms
From: Anthony Liguori <aliguori@xxxxxxxxxx>
Date: Thu, 27 Apr 2006 18:44:37 -0500
Delivery-date: Thu, 27 Apr 2006 16:45:00 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <20060427231606.GH3572@xxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <20060427223641.GG3572@xxxxxxxxxxxxxxx> <44514DE1.3000201@xxxxxxxxxx> <20060427231606.GH3572@xxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mail/News 1.5 (X11/20060309)
Aron Griffis wrote:
Hi Anthony,

Thanks for the explanation of the struct initialization.  Regarding
the second one, though...

Anthony Liguori wrote: [Thu Apr 27 2006, 07:04:01PM EDT]
Aron Griffis wrote:
#define xen_create_contiguous_region(vstart, order, address_bits) ({0;})
This is a really common one that lets you make statements into expressions.
...
#define min(a, b) ({int lhs = a; int rhs = b; (lhs < rhs) ? lhs : rhs;})

That makes sense for the example you gave, but how does it apply to
the definition in question?  Is there any difference between ({0;})
and (0) or even 0?

Can you point me to where you saw this (and in what version of Xen)?

There is no difference between (0) and 0 of course. I don't *think* there's a difference between ({0;}) and (0) but of course I've seen stranger things before. My guess is that it started it's life as a more complex set of statements and overtime was reduced to just that.

Regards,

Anthony Liguori

All of these are documented in the GCC Info page (see the section on
C Extensions).

:-)  I read that before posting, so I was familiar with the purpose of
enclosing compound statements in expressions.  But I'll reread in case
there's something I missed regarding the interpretation of ({0;})

Regards,
Aron


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel