qemu/tests/qtest/libqos
Philippe Mathieu-Daudé f7795e4096 misc: Replace zero-length arrays with flexible array member (automatic)
Description copied from Linux kernel commit from Gustavo A. R. Silva
(see [3]):

--v-- description start --v--

  The current codebase makes use of the zero-length array language
  extension to the C90 standard, but the preferred mechanism to
  declare variable-length types such as these ones is a flexible
  array member [1], introduced in C99:

  struct foo {
      int stuff;
      struct boo array[];
  };

  By making use of the mechanism above, we will get a compiler
  warning in case the flexible array does not occur last in the
  structure, which will help us prevent some kind of undefined
  behavior bugs from being unadvertenly introduced [2] to the
  Linux codebase from now on.

--^-- description end --^--

Do the similar housekeeping in the QEMU codebase (which uses
C99 since commit 7be41675f7).

All these instances of code were found with the help of the
following Coccinelle script:

  @@
  identifier s, m, a;
  type t, T;
  @@
   struct s {
      ...
      t m;
  -   T a[0];
  +   T a[];
  };
  @@
  identifier s, m, a;
  type t, T;
  @@
   struct s {
      ...
      t m;
  -   T a[0];
  +   T a[];
   } QEMU_PACKED;

[1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
[2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=76497732932f
[3] https://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux.git/commit/?id=17642a2fbd2c1

Inspired-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-03-16 22:07:42 +01:00
..
aarch64-xlnx-zcu102-machine.c tests/libqos: Move the libqos files under tests/qtest/ 2020-01-12 11:42:41 +01:00
ahci.c tests/libqos: Move the libqos files under tests/qtest/ 2020-01-12 11:42:41 +01:00
ahci.h misc: Replace zero-length arrays with flexible array member (automatic) 2020-03-16 22:07:42 +01:00
arm-imx25-pdk-machine.c tests/libqos: Move the libqos files under tests/qtest/ 2020-01-12 11:42:41 +01:00
arm-n800-machine.c tests/libqos: Move the libqos files under tests/qtest/ 2020-01-12 11:42:41 +01:00
arm-raspi2-machine.c tests/libqos: Move the libqos files under tests/qtest/ 2020-01-12 11:42:41 +01:00
arm-sabrelite-machine.c tests/libqos: Move the libqos files under tests/qtest/ 2020-01-12 11:42:41 +01:00
arm-smdkc210-machine.c tests/libqos: Move the libqos files under tests/qtest/ 2020-01-12 11:42:41 +01:00
arm-virt-machine.c tests/libqos: Move the libqos files under tests/qtest/ 2020-01-12 11:42:41 +01:00
arm-xilinx-zynq-a9-machine.c tests/libqos: Move the libqos files under tests/qtest/ 2020-01-12 11:42:41 +01:00
e1000e.c tests/libqos: Move the libqos files under tests/qtest/ 2020-01-12 11:42:41 +01:00
e1000e.h tests/libqos: Move the libqos files under tests/qtest/ 2020-01-12 11:42:41 +01:00
fw_cfg.c tests/libqos: Move the libqos files under tests/qtest/ 2020-01-12 11:42:41 +01:00
fw_cfg.h boot-order-test: fix memleaks in boot-order-test 2020-02-04 09:00:57 +01:00
i2c-imx.c tests/libqos: Move the libqos files under tests/qtest/ 2020-01-12 11:42:41 +01:00
i2c-omap.c tests/libqos: Move the libqos files under tests/qtest/ 2020-01-12 11:42:41 +01:00
i2c.c libqos: rename i2c_send and i2c_recv 2020-02-22 08:26:48 +00:00
i2c.h libqos: rename i2c_send and i2c_recv 2020-02-22 08:26:48 +00:00
libqos-pc.c tests/libqos: Move the libqos files under tests/qtest/ 2020-01-12 11:42:41 +01:00
libqos-pc.h tests/libqos: Move the libqos files under tests/qtest/ 2020-01-12 11:42:41 +01:00
libqos-spapr.c tests/libqos: Move the libqos files under tests/qtest/ 2020-01-12 11:42:41 +01:00
libqos-spapr.h tests: Silence various warnings with pseries 2020-02-03 11:33:11 +11:00
libqos.c tests/libqos: Move the libqos files under tests/qtest/ 2020-01-12 11:42:41 +01:00
libqos.h tests/libqos: Move the libqos files under tests/qtest/ 2020-01-12 11:42:41 +01:00
malloc-pc.c tests/libqos: Move the libqos files under tests/qtest/ 2020-01-12 11:42:41 +01:00
malloc-pc.h tests/libqos: Move the libqos files under tests/qtest/ 2020-01-12 11:42:41 +01:00
malloc-spapr.c tests/libqos: Move the libqos files under tests/qtest/ 2020-01-12 11:42:41 +01:00
malloc-spapr.h tests/libqos: Move the libqos files under tests/qtest/ 2020-01-12 11:42:41 +01:00
malloc.c tests/libqos: Move the libqos files under tests/qtest/ 2020-01-12 11:42:41 +01:00
malloc.h tests/libqos: Move the libqos files under tests/qtest/ 2020-01-12 11:42:41 +01:00
pci-pc.c tests/libqos: Move the libqos files under tests/qtest/ 2020-01-12 11:42:41 +01:00
pci-pc.h tests/libqos: Move the libqos files under tests/qtest/ 2020-01-12 11:42:41 +01:00
pci-spapr.c tests/libqos: Move the libqos files under tests/qtest/ 2020-01-12 11:42:41 +01:00
pci-spapr.h tests/libqos: Move the libqos files under tests/qtest/ 2020-01-12 11:42:41 +01:00
pci.c tests/libqos: Move the libqos files under tests/qtest/ 2020-01-12 11:42:41 +01:00
pci.h tests/libqos: Move the libqos files under tests/qtest/ 2020-01-12 11:42:41 +01:00
ppc64_pseries-machine.c tests/libqos: Move the libqos files under tests/qtest/ 2020-01-12 11:42:41 +01:00
qgraph.c tests/qtest/libqos/qgraph: Remove superfluous semicolons 2020-02-18 20:20:49 +01:00
qgraph.h tests/libqos: Move the libqos files under tests/qtest/ 2020-01-12 11:42:41 +01:00
qgraph_internal.h tests/libqos: Move the libqos files under tests/qtest/ 2020-01-12 11:42:41 +01:00
qos_external.c libqos: move useful qos-test funcs to qos_external 2020-02-22 08:26:48 +00:00
qos_external.h libqos: move useful qos-test funcs to qos_external 2020-02-22 08:26:48 +00:00
rtas.c tests/libqos: Move the libqos files under tests/qtest/ 2020-01-12 11:42:41 +01:00
rtas.h tests/libqos: Move the libqos files under tests/qtest/ 2020-01-12 11:42:41 +01:00
sdhci.c tests/libqos: Move the libqos files under tests/qtest/ 2020-01-12 11:42:41 +01:00
sdhci.h tests/libqos: Move the libqos files under tests/qtest/ 2020-01-12 11:42:41 +01:00
tpci200.c tests/libqos: Move the libqos files under tests/qtest/ 2020-01-12 11:42:41 +01:00
usb.c tests/libqos: Move the libqos files under tests/qtest/ 2020-01-12 11:42:41 +01:00
usb.h tests/libqos: Move the libqos files under tests/qtest/ 2020-01-12 11:42:41 +01:00
virtio-9p.c tests/libqos: Move the libqos files under tests/qtest/ 2020-01-12 11:42:41 +01:00
virtio-9p.h tests/libqos: Move the libqos files under tests/qtest/ 2020-01-12 11:42:41 +01:00
virtio-balloon.c tests/libqos: Move the libqos files under tests/qtest/ 2020-01-12 11:42:41 +01:00
virtio-balloon.h tests/libqos: Move the libqos files under tests/qtest/ 2020-01-12 11:42:41 +01:00
virtio-blk.c tests/libqos: Move the libqos files under tests/qtest/ 2020-01-12 11:42:41 +01:00
virtio-blk.h tests/libqos: Move the libqos files under tests/qtest/ 2020-01-12 11:42:41 +01:00
virtio-mmio.c tests/libqos: Move the libqos files under tests/qtest/ 2020-01-12 11:42:41 +01:00
virtio-mmio.h tests/libqos: Move the libqos files under tests/qtest/ 2020-01-12 11:42:41 +01:00
virtio-net.c tests/libqos: Move the libqos files under tests/qtest/ 2020-01-12 11:42:41 +01:00
virtio-net.h tests/libqos: Move the libqos files under tests/qtest/ 2020-01-12 11:42:41 +01:00
virtio-pci-modern.c tests/libqos: Move the libqos files under tests/qtest/ 2020-01-12 11:42:41 +01:00
virtio-pci-modern.h tests/libqos: Move the libqos files under tests/qtest/ 2020-01-12 11:42:41 +01:00
virtio-pci.c tests/libqos: Move the libqos files under tests/qtest/ 2020-01-12 11:42:41 +01:00
virtio-pci.h tests/libqos: Move the libqos files under tests/qtest/ 2020-01-12 11:42:41 +01:00
virtio-rng.c tests/libqos: Move the libqos files under tests/qtest/ 2020-01-12 11:42:41 +01:00
virtio-rng.h tests/libqos: Move the libqos files under tests/qtest/ 2020-01-12 11:42:41 +01:00
virtio-scsi.c tests/libqos: Move the libqos files under tests/qtest/ 2020-01-12 11:42:41 +01:00
virtio-scsi.h tests/libqos: Move the libqos files under tests/qtest/ 2020-01-12 11:42:41 +01:00
virtio-serial.c tests/libqos: Move the libqos files under tests/qtest/ 2020-01-12 11:42:41 +01:00
virtio-serial.h tests/libqos: Move the libqos files under tests/qtest/ 2020-01-12 11:42:41 +01:00
virtio.c tests/libqos: Move the libqos files under tests/qtest/ 2020-01-12 11:42:41 +01:00
virtio.h tests/libqos: Move the libqos files under tests/qtest/ 2020-01-12 11:42:41 +01:00
x86_64_pc-machine.c tests/libqos: Move the libqos files under tests/qtest/ 2020-01-12 11:42:41 +01:00