From: Anthony Liguori <aliguori@us.ibm.com>
To: Anthony Liguori <aliguori@us.ibm.com>, xen-devel@lists.xensource.com
Subject: Re: question regarding gnu-isms
Date: Thu, 27 Apr 2006 18:44:37 -0500 [thread overview]
Message-ID: <44515765.5020107@us.ibm.com> (raw)
In-Reply-To: <20060427231606.GH3572@vino.zko.hp.com>
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
>
next prev parent reply other threads:[~2006-04-27 23:44 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-04-27 22:36 question regarding gnu-isms Aron Griffis
2006-04-27 23:04 ` Anthony Liguori
2006-04-27 23:08 ` Mark Williamson
2006-04-27 23:41 ` Anthony Liguori
2006-04-27 23:41 ` Mark Williamson
2006-04-27 23:16 ` Aron Griffis
2006-04-27 23:44 ` Anthony Liguori [this message]
2006-04-29 1:44 ` Aron Griffis
2006-04-28 5:09 ` Andi Kleen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=44515765.5020107@us.ibm.com \
--to=aliguori@us.ibm.com \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.