[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PULL v4 05/23] compiler: rework BUG_ON using a struct
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PULL v4 05/23] compiler: rework BUG_ON using a struct |
Date: |
Tue, 31 Jan 2017 12:53:34 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 |
On 01/31/2017 12:42 PM, Michael S. Tsirkin wrote:
> There are theoretical concerns that some compilers might not trigger
> build failures on attempts to define an array of size (x ? -1 : 1) where
> x is a variable and make it a variable sized array instead. Let rewrite
s/Let/Let's/
> using a struct with a negative bit field size instead as there are no
> dynamic bit field sizes. This is similar to what Linux does.
On one of the earlier review spins, I suggested making it explicit that
we are now requiring that the condition be a compile-time constant (you
got that wording in 2/23, but not here) - food for thought if you have
to respin this.
>
> Signed-off-by: Michael S. Tsirkin <address@hidden>
> Reviewed-by: Eric Blake <address@hidden>
> Reviewed-by: Markus Armbruster <address@hidden>
> ---
> include/qemu/compiler.h | 10 +++++++---
> 1 file changed, 7 insertions(+), 3 deletions(-)
--
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 00/23] virtio, vhost, pci: fixes, features, Michael S. Tsirkin, 2017/01/31
- [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
- Re: [Qemu-devel] [PULL v4 05/23] compiler: rework BUG_ON using a struct,
Eric Blake <=
- [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
- [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