On 9/27/18 11:42 AM, 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 bug by not using the
"modify in place" byte swapping functions.

This patch was produced with the following spatch script:


Will queue through my NBD tree.


Signed-off-by: Peter Maydell <peter.mayd...@linaro.org>
---
Disclaimer: tested only with "make check", but it is a mechanically
generated patch...


Reviewed-by: Eric Blake <ebl...@redhat.com>

Conflicts with my pending NBD pull request, but I can touch that up (and ensure that it gets more than just compile-time testing, even though I agree that the change is safe from a pure review standpoint).

--
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org

Reply via email to