Re: [Qemu-block] [PATCH] block/vdi: Don't take address of fields in packed structs

2018-11-05 Thread Peter Maydell
On 17 October 2018 at 15:55, Kevin Wolf wrote: > Am 16.10.2018 um 19:25 hat Peter Maydell geschrieben: >> 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

Re: [Qemu-block] [PATCH] block/vdi: Don't take address of fields in packed structs

2018-10-17 Thread Kevin Wolf
Am 16.10.2018 um 19:25 hat Peter Maydell geschrieben: > 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

Re: [Qemu-block] [PATCH] block/vdi: Don't take address of fields in packed structs

2018-10-17 Thread Stefan Hajnoczi
On Tue, Oct 16, 2018 at 06:25:03PM +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

[Qemu-block] [PATCH] block/vdi: Don't take address of fields in packed structs

2018-10-16 Thread Peter Maydell
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