On Tue, Oct 16, 2018 at 06:09:38PM +0100, 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. > > There are a few places where the in-place swap function is > used on something other than a packed struct field; we convert > those anyway, for consistency. > > Patch produced with scripts/coccinelle/inplace-byteswaps.cocci. > > Signed-off-by: Peter Maydell <peter.mayd...@linaro.org> > --- > Usual disclaimer: produced with "make check" only, but purely > automated conversion should be safe. > > block/vhdx.h | 12 ++--- > block/vhdx-endian.c | 118 ++++++++++++++++++++++---------------------- > block/vhdx-log.c | 4 +- > block/vhdx.c | 18 +++---- > 4 files changed, 76 insertions(+), 76 deletions(-)
Reviewed-by: Stefan Hajnoczi <stefa...@redhat.com>
signature.asc
Description: PGP signature