[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PULL v4 07/23] compiler: expression version of QEMU_BU
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PULL v4 07/23] compiler: expression version of QEMU_BUILD_BUG_ON |
Date: |
Tue, 31 Jan 2017 12:56:31 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 |
On 01/31/2017 12:43 PM, Michael S. Tsirkin wrote:
> QEMU_BUILD_BUG_ON uses a typedef in order to be safe
> to use outside functions, but sometimes it's useful
> to have a version that can be used within an expression.
> Following what Linux does, introduce QEMU_BUILD_BUG_ON_ZERO
> that return zero after checking condition at build time.
>
> Signed-off-by: Michael S. Tsirkin <address@hidden>
> Reviewed-by: Eric Blake <address@hidden>
> Reviewed-by: Markus Armbruster <address@hidden>
> ---
> include/qemu/compiler.h | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/include/qemu/compiler.h b/include/qemu/compiler.h
> index e0ce9ff..462ade2 100644
> --- a/include/qemu/compiler.h
> +++ b/include/qemu/compiler.h
> @@ -100,6 +100,9 @@
> #define QEMU_BUILD_BUG_ON_ZERO(x) (sizeof(QEMU_BUILD_BUG_ON_STRUCT(x)) - \
> sizeof(QEMU_BUILD_BUG_ON_STRUCT(x)))
>
> +#define QEMU_BUILD_BUG_ON_ZERO(x) (sizeof(QEMU_BUILD_BUG_ON_STRUCT(x)) - \
> + sizeof(QEMU_BUILD_BUG_ON_STRUCT(x)))
> +
Umm, we don't want this defined twice. I think you have a rebase
mistake, where 6/23 is bogus (it repeats the commit message of 4/23 and
the contents of 7/23).
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
- [Qemu-devel] [PULL v4 01/23] compiler: drop ; after BUILD_BUG_ON, (continued)
- [Qemu-devel] [PULL v4 01/23] compiler: drop ; after BUILD_BUG_ON, Michael S. Tsirkin, 2017/01/31
- [Qemu-devel] [PULL v4 02/23] qxl: switch to constants within BUILD_BUG_ON, Michael S. Tsirkin, 2017/01/31
- [Qemu-devel] [PULL v4 03/23] ppc: switch to constants within BUILD_BUG_ON, Michael S. Tsirkin, 2017/01/31
- [Qemu-devel] [PULL v4 05/23] compiler: rework BUG_ON using a struct, Michael S. Tsirkin, 2017/01/31
- [Qemu-devel] [PULL v4 04/23] QEMU_BUILD_BUG_ON: use __COUNTER__, Michael S. Tsirkin, 2017/01/31
- [Qemu-devel] [PULL v4 06/23] QEMU_BUILD_BUG_ON: use __COUNTER__, Michael S. Tsirkin, 2017/01/31
- [Qemu-devel] [PULL v4 08/23] ARRAY_SIZE: check that argument is an array, Michael S. Tsirkin, 2017/01/31
- [Qemu-devel] [PULL v4 07/23] compiler: expression version of QEMU_BUILD_BUG_ON, Michael S. Tsirkin, 2017/01/31
- Re: [Qemu-devel] [PULL v4 07/23] compiler: expression version of QEMU_BUILD_BUG_ON,
Eric Blake <=
- [Qemu-devel] [PULL v4 09/23] pci: mark ROMs read-only, Michael S. Tsirkin, 2017/01/31
- [Qemu-devel] [PULL v4 10/23] intel_iommu: fix and simplify size calculation in process_device_iotlb_desc(), Michael S. Tsirkin, 2017/01/31
- [Qemu-devel] [PULL v4 12/23] hw/ioh3420: derive from PCI Express Root Port base class, Michael S. Tsirkin, 2017/01/31
- [Qemu-devel] [PULL v4 11/23] hw/pcie: Introduce a base class for PCI Express Root Ports, Michael S. Tsirkin, 2017/01/31
- [Qemu-devel] [PULL v4 13/23] hw/pcie: Introduce Generic PCI Express Root Port, Michael S. Tsirkin, 2017/01/31
- [Qemu-devel] [PULL v4 14/23] hw/i386: check if nvdimm is enabled before plugging, Michael S. Tsirkin, 2017/01/31
- [Qemu-devel] [PULL v4 15/23] msix: Follow CODING_STYLE, Michael S. Tsirkin, 2017/01/31
- [Qemu-devel] [PULL v4 16/23] hcd-xhci: check & correct param before using it, Michael S. Tsirkin, 2017/01/31
- [Qemu-devel] [PULL v4 18/23] virtio: make virtio_should_notify static, Michael S. Tsirkin, 2017/01/31
- [Qemu-devel] [PULL v4 19/23] vhost: skip ROM sections, Michael S. Tsirkin, 2017/01/31