[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2] hw/s390/ccw.c: Don't take address of packed
Re: [Qemu-devel] [PATCH v2] hw/s390/ccw.c: Don't take address of packed members
Thu, 13 Dec 2018 21:06:58 +0100
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1
On 2018-12-13 13:02, Peter Maydell wrote:
> Taking the address of a field in a packed struct is a bad idea, because
> it might not be actually aligned enough for that pointer type (and
> thus cause a crash on dereference on some host architectures). Newer
> versions of clang warn about this.
> Avoid the problem by using local copies of the PMCW and SCSW
> struct fields in copy_schib_from_guest() and copy_schib_to_guest().
> Signed-off-by: Peter Maydell <address@hidden>
> v1->v2 changes:
> * add comment about why we're using locals
Reviewed-by: Thomas Huth <address@hidden>