]> git.proxmox.com Git - mirror_qemu.git/commit
hw/s390x/3270-ccw: avoid taking address of fields in packed struct
authorDaniel P. Berrangé <berrange@redhat.com>
Fri, 29 Mar 2019 11:11:04 +0000 (11:11 +0000)
committerCornelia Huck <cohuck@redhat.com>
Wed, 3 Apr 2019 09:19:57 +0000 (11:19 +0200)
commit7357b2215978debf2fd17b525ba745d3c69272a3
tree2f9a51246730f130395d0cc8ff5fbdf7b2fc1093
parent5d45a332920d6dd5536ba5f886713f5a213f90bb
hw/s390x/3270-ccw: avoid taking address of fields in packed struct

Compiling with GCC 9 complains

hw/s390x/3270-ccw.c: In function ‘emulated_ccw_3270_cb’:
hw/s390x/3270-ccw.c:81:19: error: taking address of packed member of ‘struct SCHIB’ may result in an unaligned pointer value [-Werror=address-of-packed-member]
   81 |         SCSW *s = &sch->curr_status.scsw;
      |                   ^~~~~~~~~~~~~~~~~~~~~~

This local variable is only present to save a little bit of
typing when setting the field later. Get rid of this to avoid
the warning about unaligned accesses.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20190329111104.17223-15-berrange@redhat.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
hw/s390x/3270-ccw.c