xemu/hw/acpi
Philippe Mathieu-Daudé 9cbb8eca17 hw/acpi: Use QEMU_NONSTRING for non NUL-terminated arrays
GCC 8 added a -Wstringop-truncation warning:

  The -Wstringop-truncation warning added in GCC 8.0 via r254630 for
  bug 81117 is specifically intended to highlight likely unintended
  uses of the strncpy function that truncate the terminating NUL
  character from the source string.

This new warning leads to compilation failures:

    CC      hw/acpi/core.o
  In function 'acpi_table_install', inlined from 'acpi_table_add' at qemu/hw/acpi/core.c:296:5:
  qemu/hw/acpi/core.c:184:9: error: 'strncpy' specified bound 4 equals destination size [-Werror=stringop-truncation]
           strncpy(ext_hdr->sig, hdrs->sig, sizeof ext_hdr->sig);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  make: *** [qemu/rules.mak:69: hw/acpi/core.o] Error 1

Use the QEMU_NONSTRING attribute, since ACPI tables don't require the
strings to be NUL-terminated.

Suggested-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
2019-01-17 21:10:57 -05:00
..
acpi_interface.c
acpi-stub.c
aml-build.c hw: acpi: Export and share the ARM RSDP build 2018-12-19 16:48:16 -05:00
bios-linker-loader.c
core.c hw/acpi: Use QEMU_NONSTRING for non NUL-terminated arrays 2019-01-17 21:10:57 -05:00
cpu_hotplug.c
cpu.c pci, pc, virtio: fixes, features 2018-09-24 18:49:11 +01:00
ich9.c
ipmi-stub.c
ipmi.c
Makefile.objs acpi: build TPM Physical Presence interface 2019-01-17 21:10:57 -05:00
memory_hotplug.c hw: acpi: Fix memory hotplug AML generation error 2019-01-17 21:10:57 -05:00
nvdimm.c hw/acpi/nvdimm: Don't take address of fields in packed structs 2018-11-12 15:14:06 +00:00
pcihp.c pci/pcihp: perform unplug via the hotplug handler 2018-12-20 11:19:12 -05:00
piix4.c pci/pcihp: perform unplug via the hotplug handler 2018-12-20 11:19:12 -05:00
tco.c
tpm.c acpi: add ACPI memory clear interface 2019-01-17 21:10:57 -05:00
trace-events
vmgenid.c