[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PULL 00/32] Block layer patches
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PULL 00/32] Block layer patches |
Date: |
Mon, 11 Jul 2016 10:25:38 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 |
On 07/11/2016 10:14 AM, Peter Maydell wrote:
>
> Format string warning on OSX, I'm afraid:
>
> /Users/pm215/src/qemu-for-merges/qemu-io-cmds.c:393:69: warning:
> format specifies type 'size_t' (aka 'unsigned long') but the argument
> has type 'unsigned long long' [-Wformat]
> printf("Argument '%s' exceeds maximum size %zu\n", arg, SIZE_MAX);
> ~~~ ^~~~~~~~
> %llu
> /usr/include/stdint.h:153:20: note: expanded from macro 'SIZE_MAX'
> #define SIZE_MAX UINT64_MAX
> ^~~~~~~~~~
> /usr/include/stdint.h:87:27: note: expanded from macro 'UINT64_MAX'
> #define UINT64_MAX 18446744073709551615ULL
> ^~~~~~~~~~~~~~~~~~~~~~~
>
> This is a bug in the OSX system headers, but we need to work around
> it. This came up last year for some other format strings in the
> some source file, so the same fix should be ok here:
> https://patchwork.ozlabs.org/patch/542327/
Back then, our "fix" was a hack to add an explicit (uint64_t) cast at
the point of the printf, but that doesn't scale. Wouldn't a better fix
be to osdep.h to add something along the lines of:
#if witness_for_buggy_header
#undef SIZE_MAX
#define SIZE_MAX working expression
#endif
so that it is fixed in one place for all uses?
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
- [Qemu-devel] [PULL 22/32] block: Remove BB options from blockdev-add, (continued)
- [Qemu-devel] [PULL 22/32] block: Remove BB options from blockdev-add, Kevin Wolf, 2016/07/08
- [Qemu-devel] [PULL 24/32] qcow2: Avoid making the L1 table too big, Kevin Wolf, 2016/07/08
- [Qemu-devel] [PULL 28/32] vmdk: fix metadata write regression, Kevin Wolf, 2016/07/08
- [Qemu-devel] [PULL 27/32] Improve block job rate limiting for small bandwidth values, Kevin Wolf, 2016/07/08
- [Qemu-devel] [PULL 16/32] coroutine: move entry argument to qemu_coroutine_create, Kevin Wolf, 2016/07/08
- [Qemu-devel] [PULL 29/32] blockdev: Fix regression with the default naming of throttling groups, Kevin Wolf, 2016/07/08
- [Qemu-devel] [PULL 30/32] qemu-iotests: Test naming of throttling groups, Kevin Wolf, 2016/07/08
- [Qemu-devel] [PULL 31/32] hmp: use snapshot name to determine whether a snapshot is 'fully available', Kevin Wolf, 2016/07/08
- [Qemu-devel] [PULL 32/32] hmp: show all of snapshot info on every block dev in output of 'info snapshots', Kevin Wolf, 2016/07/08
- Re: [Qemu-devel] [PULL 00/32] Block layer patches, Peter Maydell, 2016/07/11
- Re: [Qemu-devel] [PULL 00/32] Block layer patches,
Eric Blake <=