From: PUCCETTI Armand <armand.puccetti@cea.fr>
To: Anthony Liguori <aliguori@us.ibm.com>
Cc: xen-devel@lists.xensource.com
Subject: Re: non-ANSI Unions
Date: Fri, 23 Mar 2007 17:00:31 +0100 [thread overview]
Message-ID: <4603F99F.5040100@cea.fr> (raw)
In-Reply-To: <4603F533.5070003@us.ibm.com>
Sorry, it was an err in the tool. Such unions are now understood properly.
Anthony Liguori a écrit :
> PUCCETTI Armand wrote:
>> Many "unions' are present in the code, but are non-ANSI!
>
> Anonymous unions/structs are a rather common C extension. They are
> much preferred to using a named union for the syntactical convenience
> of writing:
>
> page_info.list
>
> vs writing:
>
> page_info.u.list
>
> Also, this is not the only C extension that Xen utilizes. If your
> analysis tool doesn't support the various GCC extensions, then it's
> not going to be much help.
>
> Regards,
>
> Anthony Liguori
>
>> For instance, I see:
>>
>> struct page_info
>> {
>> /* Each frame can be threaded onto a doubly-linked list. */
>> union {
>> struct list_head list;
>> /* Shadow uses this field as an up-pointer in lower-level
>> shadows */
>> paddr_t up;
>> };
>> /* Reference count and various PGC_xxx flags and fields. */
>> u32 count_info;
>> ...}
>>
>> which should be written properly:
>>
>> struct page_info
>> {
>> /* Each frame can be threaded onto a doubly-linked list. */
>> union {
>> struct list_head list;
>> /* Shadow uses this field as an up-pointer in lower-level
>> shadows */
>> paddr_t up;
>> } foo;
>>
>> /* Reference count and various PGC_xxx flags and fields. */
>> u32 count_info;
>> ...}
>>
>> Is there any good reason to do so? Is it possible to change that, to
>> comply with the standard
>> (and therefore with analysis tools too) ?
>>
>> Armand
>
>
prev parent reply other threads:[~2007-03-23 16:00 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-23 15:33 non-ANSI Unions PUCCETTI Armand
2007-03-23 15:41 ` Anthony Liguori
2007-03-23 16:00 ` PUCCETTI Armand [this message]
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=4603F99F.5040100@cea.fr \
--to=armand.puccetti@cea.fr \
--cc=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.