qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Cao jin <caoj.fnst@cn.fujitsu.com>
To: Eric Blake <eblake@redhat.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v3 3/4] Add Error **errp for xen_pt_config_init()
Date: Fri, 8 Jan 2016 16:41:56 +0800	[thread overview]
Message-ID: <568F7654.1030300@cn.fujitsu.com> (raw)
In-Reply-To: <568E97AD.4000701@redhat.com>



On 01/08/2016 12:51 AM, Eric Blake wrote:
> On 01/07/2016 01:12 AM, Cao jin wrote:
>
>>>>                if (rc < 0) {
>>>> -                XEN_PT_LOG(&s->dev, "Failed to initialize %d/%ld,
>>>> type=0x%x, rc:%d\n",
>>>> -                           i, ARRAY_SIZE(xen_pt_emu_reg_grps),
>>>> +                error_setg(&local_err, "Failed to initialize %d/%ld,
>>>> type=0x%x,"
>>>> +                           " rc:%d", i,
>>>> ARRAY_SIZE(xen_pt_emu_reg_grps),
>>>
>>> This maps ARRAY_SIZE() (which is size_t) to %ld, which can fail to
>>> compile on 32-bit platforms (where size_t is not necessarily long).  Fix
>>> it to %zd while touching it.
>>>
>>
>> a question:
>> 1. Is %zu more suitable for size_t? since size_t is unsigned integer.
>
> Yes, you're right on that one.
>
>>
>> and a personal question after digging into size_t:
>> 2. Does the size of size_t always equal to the word length[*] of computer
>
> No.  It equals the maximum size the program can use.  But the x32 ABI
> project is a good example of a 32-bit size_t while still taking full
> advantage of the 64-bit word size registers, in the name of memory
> efficiencies.  See https://en.wikipedia.org/wiki/X32_ABI.
>

Thanks very much. Have send v4 version, hope I don`t miss any comment:)

-- 
Yours Sincerely,

Cao jin

  reply	other threads:[~2016-01-08  8:39 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-06  2:39 [Qemu-devel] [PATCH v3 0/4] Convert to realize() Cao jin
2016-01-06  2:39 ` [Qemu-devel] [PATCH v3 1/4] Add Error **errp for xen_host_pci_device_get() Cao jin
2016-01-06 15:51   ` Eric Blake
2016-01-07  3:13     ` Cao jin
2016-01-07 16:47       ` Eric Blake
2016-01-06  2:39 ` [Qemu-devel] [PATCH v3 2/4] Add Error **errp for xen_pt_setup_vga() Cao jin
2016-01-06 15:53   ` Eric Blake
2016-01-07  3:26     ` Cao jin
2016-01-06  2:39 ` [Qemu-devel] [PATCH v3 3/4] Add Error **errp for xen_pt_config_init() Cao jin
2016-01-06 16:02   ` Eric Blake
2016-01-07  8:12     ` Cao jin
2016-01-07 16:51       ` Eric Blake
2016-01-08  8:41         ` Cao jin [this message]
2016-01-06  2:39 ` [Qemu-devel] [PATCH v3 4/4] Xen PCI passthru: convert to realize() Cao jin
2016-01-06 16:07   ` Eric Blake
2016-01-07  7:16     ` Cao jin
2016-01-07 16:53       ` Eric Blake
2016-01-06 11:08 ` [Qemu-devel] [PATCH v3 0/4] Convert " Stefano Stabellini
2016-01-06 15:51   ` Eric Blake
2016-01-06 16:02     ` Stefano Stabellini

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=568F7654.1030300@cn.fujitsu.com \
    --to=caoj.fnst@cn.fujitsu.com \
    --cc=eblake@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).