qemu-e2k/hw/s390x
Daniele Buono a58cabd0e3 s390x: Avoid variable size warning in ipl.h
S390IPLState contains two IplParameterBlock, which may in turn have
either a IPLBlockPV or a IplBlockFcp, both ending with a variable
sized field (an array).

This causes a warning with clang 11 or greater, which checks that
variable sized type are only allocated at the end of the struct:

In file included from ../qemu-cfi-v3/target/s390x/diag.c:21:
../qemu-cfi-v3/hw/s390x/ipl.h:161:23: error: field 'iplb' with variable sized type 'IplParameterBlock' (aka 'union IplParameterBlock') not at the end of a struct or class is a GNU extension [-Werror,-Wgnu-variable-sized-type-not-at-end]
    IplParameterBlock iplb;
                      ^
../qemu-cfi-v3/hw/s390x/ipl.h:162:23: error: field 'iplb_pv' with variable sized type 'IplParameterBlock' (aka 'union IplParameterBlock') not at the end of a struct or class is a GNU extension [-Werror,-Wgnu-variable-sized-type-not-at-end]
    IplParameterBlock iplb_pv;

In this case, however, the warning is a false positive, because
IPLBlockPV and IplBlockFcp are allocated in a union wrapped at 4K,
making the union non-variable sized.

Fix the warning by turning the two variable sized arrays into arrays
of size 0. This avoids the compiler error and should produce the
same code.

Signed-off-by: Daniele Buono <dbuono@linux.vnet.ibm.com>
Message-Id: <20201105221905.1350-5-dbuono@linux.vnet.ibm.com>
Acked-by: Cornelia Huck <cohuck@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
2020-11-10 08:51:30 +01:00
..
3270-ccw.c
ap-bridge.c
ap-device.c
ccw-device.c
ccw-device.h
css-bridge.c
css.c hw/s390x/css: Remove double initialization 2020-10-02 13:52:49 +02:00
event-facility.c s390/sclp: read sccb from mem based on provided length 2020-10-02 13:52:49 +02:00
ipl.c
ipl.h s390x: Avoid variable size warning in ipl.h 2020-11-10 08:51:30 +01:00
Kconfig
meson.build s390x: fix build for --without-default-devices 2020-11-05 13:04:07 +01:00
pv.c
s390-ccw.c
s390-pci-bus.c s390x/pci: get zPCI function info from host 2020-11-01 12:30:52 -07:00
s390-pci-inst.c s390x/pci: use a PCI Function structure 2020-11-01 12:30:52 -07:00
s390-pci-vfio.c s390x/pci: get zPCI function info from host 2020-11-01 12:30:52 -07:00
s390-skeys-kvm.c
s390-skeys.c
s390-stattrib-kvm.c
s390-stattrib.c
s390-virtio-ccw.c s390x/pci: Move header files to include/hw/s390x 2020-11-01 12:30:51 -07:00
s390-virtio-hcall.c
s390-virtio-hcall.h
sclp.c s390x: pv: Remove sclp boundary checks 2020-10-22 15:47:27 +02:00
sclpcpu.c
sclpquiesce.c
tod-kvm.c
tod-qemu.c
tod.c
trace-events s390x/pci: get zPCI function info from host 2020-11-01 12:30:52 -07:00
trace.h
vhost-user-fs-ccw.c
vhost-vsock-ccw.c vhost-vsock-ccw: force virtio version 1 2020-09-29 02:15:24 -04:00
virtio-ccw-9p.c
virtio-ccw-balloon.c
virtio-ccw-blk.c
virtio-ccw-crypto.c
virtio-ccw-gpu.c
virtio-ccw-input.c
virtio-ccw-net.c
virtio-ccw-rng.c
virtio-ccw-scsi.c
virtio-ccw-serial.c
virtio-ccw.c
virtio-ccw.h