xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Xen-devel <xen-devel@lists.xen.org>
Subject: Re: [PATCH] tools/libxc: Annotate xc_report_error with __attribute__((format))
Date: Thu, 5 Jun 2014 14:58:18 +0100	[thread overview]
Message-ID: <5390777A.5090402@citrix.com> (raw)
In-Reply-To: <1401973910.15729.74.camel@hastur.hellion.org.uk>

On 05/06/14 14:11, Ian Campbell wrote:
> On Tue, 2014-06-03 at 18:45 +0100, Andrew Cooper wrote:
>> diff --git a/tools/libxc/xc_domain_restore.c b/tools/libxc/xc_domain_restore.c
>> index 89af1ad..d950639 100644
>> --- a/tools/libxc/xc_domain_restore.c
>> +++ b/tools/libxc/xc_domain_restore.c
>> @@ -102,7 +102,7 @@ static ssize_t rdexact(xc_interface *xch, struct restore_ctx *ctx,
>>              errno = 0;
>>          }
>>          if ( len <= 0 ) {
>> -            ERROR("%s failed (read rc: %d, errno: %d)", __func__, len, errno);
>> +            ERROR("%s failed (read rc: %ld, errno: %d)", __func__, (long)len, errno);
> The correct way to print an ssize_t is %zd.

Odd - I thought I tried that and it failed, but clearly I failed to try
it correctly.

>
>>              return -1;
>>          }
>>          offset += len;
>> @@ -443,7 +443,7 @@ static int compat_buffer_qemu(xc_interface *xch, struct restore_ctx *ctx,
>>      }
>>  
>>      if ( memcmp(qbuf, "QEVM", 4) ) {
>> -        ERROR("Invalid QEMU magic: 0x%08x", *(unsigned long*)qbuf);
>> +        ERROR("Invalid QEMU magic: 0x%08x", *(uint32_t*)qbuf);
> 0x%08lx with unsigned long or 0x%PRIx32 with uint32_t, not some hybrid,
> please. (I thin %..lx is the right answer here)

qbuf is strictly 4 bytes, as identified in the line above.  PRIx32 it
is.  (I remember deciding on PRIx32 and clearly failed to implement it
properly)

v2 on its way.

~Andrew

      reply	other threads:[~2014-06-05 13:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-03 17:45 [PATCH] tools/libxc: Annotate xc_report_error with __attribute__((format)) Andrew Cooper
2014-06-05 13:11 ` Ian Campbell
2014-06-05 13:58   ` Andrew Cooper [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=5390777A.5090402@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=ian.campbell@citrix.com \
    --cc=xen-devel@lists.xen.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).