All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: QEMU Developers <qemu-devel@nongnu.org>, Eric Blake <eblake@redhat.com>
Subject: Re: [Qemu-devel] [PULL 00/30] KVM, build, NBD, SCSI patches for 2016-06-16
Date: Thu, 16 Jun 2016 18:29:30 +0200	[thread overview]
Message-ID: <7a3acf1b-ff2b-e298-bf4e-9e20f1974965@redhat.com> (raw)
In-Reply-To: <CAFEAcA-8cbwqVNb-6knUUcfZjyhDJTKxy06p1Z16xBXrGO=z5Q@mail.gmail.com>



On 16/06/2016 18:02, Peter Maydell wrote:
> Hi. I'm afraid this generates format string warnings on OSX:

Interesting, I did test clang this time.  I'll fix it but really this 
is a compiler bug.  It's *impossible* to pass a short variable 
argument, hence va_arg(ap, short) *must* be the same as va_arg(ap, int).

I should start making a list of pointless clang warnings.

Paolo

diff --git a/nbd/server.c b/nbd/server.c
index ba950973..a677e26 100644
--- a/nbd/server.c
+++ b/nbd/server.c
@@ -576,7 +576,7 @@ static coroutine_fn int nbd_negotiate(NBDClientNewData *data)
     oldStyle = client->exp != NULL && !client->tlscreds;
     if (oldStyle) {
         assert ((client->exp->nbdflags & ~65535) == 0);
-        TRACE("advertising size %" PRIu64 " and flags %" PRIx16,
+        TRACE("advertising size %" PRIu64 " and flags %x",
               client->exp->size, client->exp->nbdflags | myflags);
         stq_be_p(buf + 8, NBD_CLIENT_MAGIC);
         stq_be_p(buf + 16, client->exp->size);
@@ -607,7 +607,7 @@ static coroutine_fn int nbd_negotiate(NBDClientNewData *data)
         }
 
         assert ((client->exp->nbdflags & ~65535) == 0);
-        TRACE("advertising size %" PRIu64 " and flags %" PRIx16,
+        TRACE("advertising size %" PRIu64 " and flags %x",
               client->exp->size, client->exp->nbdflags | myflags);
         stq_be_p(buf + 18, client->exp->size);
         stw_be_p(buf + 26, client->exp->nbdflags | myflags);


> /Users/pm215/src/qemu-for-merges/nbd/server.c:580:34: warning: format
> specifies type 'unsigned short' but the argument has type 'unsigned
> int' [-Wformat]
>               client->exp->size, client->exp->nbdflags | myflags);
>                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> /Users/pm215/src/qemu-for-merges/nbd/nbd-internal.h:44:21: note:
> expanded from macro 'TRACE'
>         LOG(msg, ## __VA_ARGS__); \
>                     ^
> /Users/pm215/src/qemu-for-merges/nbd/nbd-internal.h:50:50: note:
> expanded from macro 'LOG'
>             __FILE__, __FUNCTION__, __LINE__, ## __VA_ARGS__); \
>                                                  ^
> /Users/pm215/src/qemu-for-merges/nbd/server.c:611:34: warning: format
> specifies type 'unsigned short' but the argument has type 'unsigned
> int' [-Wformat]
>               client->exp->size, client->exp->nbdflags | myflags);
>                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> /Users/pm215/src/qemu-for-merges/nbd/nbd-internal.h:44:21: note:
> expanded from macro 'TRACE'
>         LOG(msg, ## __VA_ARGS__); \
>                     ^
> /Users/pm215/src/qemu-for-merges/nbd/nbd-internal.h:50:50: note:
> expanded from macro 'LOG'
>             __FILE__, __FUNCTION__, __LINE__, ## __VA_ARGS__); \
>                                                  ^
>   CC    nbd/client.o
>   CC    nbd/common.o
>   CC    block/curl.o
> /Users/pm215/src/qemu-for-merges/nbd/client.c:715:57: warning: format
> specifies type 'unsigned short' but the argument has type 'uint32_t'
> (aka 'unsigned int') [-Wformat]
>           request->from, request->len, request->handle, request->type);
>                                                         ^~~~~~~~~~~~~
> /Users/pm215/src/qemu-for-merges/nbd/nbd-internal.h:44:21: note:
> expanded from macro 'TRACE'
>         LOG(msg, ## __VA_ARGS__); \
>                     ^
> /Users/pm215/src/qemu-for-merges/nbd/nbd-internal.h:50:50: note:
> expanded from macro 'LOG'
>             __FILE__, __FUNCTION__, __LINE__, ## __VA_ARGS__); \
>                                                  ^

  reply	other threads:[~2016-06-16 16:29 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-16 14:15 [Qemu-devel] [PULL 00/30] KVM, build, NBD, SCSI patches for 2016-06-16 Paolo Bonzini
2016-06-16 14:15 ` [Qemu-devel] [PULL 01/30] configure: Remove unused CONFIG_ZERO_MALLOC setting Paolo Bonzini
2016-06-16 14:15 ` [Qemu-devel] [PULL 02/30] os-posix: include sys/mman.h Paolo Bonzini
2016-06-16 14:15 ` [Qemu-devel] [PULL 03/30] clean-includes: run it once more Paolo Bonzini
2016-06-16 14:15 ` [Qemu-devel] [PULL 04/30] configure: Enable -Werror for MinGW builds, too Paolo Bonzini
2016-06-16 14:16 ` [Qemu-devel] [PULL 05/30] Makefile: Fix tag file generation targets Paolo Bonzini
2016-06-16 14:16 ` [Qemu-devel] [PULL 06/30] Make avx2 configure test work with -O2 Paolo Bonzini
2016-06-16 14:16 ` [Qemu-devel] [PULL 07/30] avx2 configure: Use primitives in test Paolo Bonzini
2016-06-16 14:16 ` [Qemu-devel] [PULL 08/30] configure: Remove unused CONFIG_SIGEV_THREAD_ID switch Paolo Bonzini
2016-06-16 14:16 ` [Qemu-devel] [PULL 09/30] nbd: Don't use *_to_cpup() functions Paolo Bonzini
2016-06-16 14:16 ` [Qemu-devel] [PULL 10/30] nbd: Don't use cpu_to_*w() functions Paolo Bonzini
2016-06-16 14:16 ` [Qemu-devel] [PULL 11/30] nbd: simplify the nbd_request and nbd_reply structs Paolo Bonzini
2016-06-16 14:16 ` [Qemu-devel] [PULL 12/30] target-i386: kvm: cache KVM_GET_SUPPORTED_CPUID data Paolo Bonzini
2016-06-16 14:16 ` [Qemu-devel] [PULL 13/30] scsi-disk: Use (unsigned long) typecasts when using "%lu" format string Paolo Bonzini
2016-06-16 14:16 ` [Qemu-devel] [PULL 14/30] linux-headers: update to Linux 4.6 Paolo Bonzini
2016-06-16 16:09   ` Christian Borntraeger
2016-06-16 16:31     ` Greg Kurz
2016-06-16 14:16 ` [Qemu-devel] [PULL 15/30] KVM: use KVM_CAP_MAX_VCPU_ID Paolo Bonzini
2016-06-16 14:16 ` [Qemu-devel] [PULL 16/30] vl.c: Add '-L help' which lists data dirs Paolo Bonzini
2016-06-16 14:16 ` [Qemu-devel] [PULL 17/30] nbd: Use BDRV_REQ_FUA for better FUA where supported Paolo Bonzini
2016-06-16 14:16 ` [Qemu-devel] [PULL 18/30] nbd: More debug typo fixes, use correct formats Paolo Bonzini
2016-06-16 14:16 ` [Qemu-devel] [PULL 19/30] nbd: Quit server after any write error Paolo Bonzini
2016-06-16 14:16 ` [Qemu-devel] [PULL 20/30] nbd: Improve server handling of bogus commands Paolo Bonzini
2016-06-16 14:16 ` [Qemu-devel] [PULL 21/30] nbd: Reject unknown request flags Paolo Bonzini
2016-06-16 14:16 ` [Qemu-devel] [PULL 22/30] nbd: Group all Linux-specific ioctl code in one place Paolo Bonzini
2016-06-16 14:16 ` [Qemu-devel] [PULL 23/30] nbd: Clean up ioctl handling of qemu-nbd -c Paolo Bonzini
2016-06-16 14:16 ` [Qemu-devel] [PULL 24/30] nbd: Detect servers that send unexpected error values Paolo Bonzini
2016-06-16 14:16 ` [Qemu-devel] [PULL 25/30] nbd: Avoid magic number for NBD max name size Paolo Bonzini
2016-06-16 14:16 ` [Qemu-devel] [PULL 26/30] scsi: esp: check buffer length before reading scsi command Paolo Bonzini
2016-06-16 14:16 ` [Qemu-devel] [PULL 27/30] scsi: esp: respect FIFO invariant after message phase Paolo Bonzini
2016-06-16 14:16 ` [Qemu-devel] [PULL 28/30] scsi: esp: clean up handle_ti/esp_do_dma if s->do_cmd Paolo Bonzini
2016-06-16 14:16 ` [Qemu-devel] [PULL 29/30] scsi: esp: make cmdbuf big enough for maximum CDB size Paolo Bonzini
2016-06-16 14:16 ` [Qemu-devel] [PULL 30/30] vl: smp_parse: cleanups Paolo Bonzini
2016-06-21 15:40   ` Igor Mammedov
2016-06-21 16:22     ` Andrew Jones
2016-06-16 16:02 ` [Qemu-devel] [PULL 00/30] KVM, build, NBD, SCSI patches for 2016-06-16 Peter Maydell
2016-06-16 16:29   ` Paolo Bonzini [this message]
2016-06-16 16:55     ` Peter Maydell
2016-06-16 17:01       ` Paolo Bonzini
2016-06-16 17:08         ` Peter Maydell

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=7a3acf1b-ff2b-e298-bf4e-9e20f1974965@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=eblake@redhat.com \
    --cc=peter.maydell@linaro.org \
    --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 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.