Re: [Qemu-devel] SLIRP warning messages displayed while compiling

2017-08-14 Thread Eric Blake
On 08/12/2017 10:38 AM, Philippe Mathieu-Daudé wrote: > Hi Eric, > > On 08/12/2017 08:41 AM, Eric Blake wrote: >> Here's an idea: Instead of using struct ip6 { ... } QEMU_PACKED, use >> >> struct ip6 { >> ... >> }; >> QEMU_BUG_ON(sizeof(struct ip6) != 32); >> >> so that the compiler explicitly

Re: [Qemu-devel] SLIRP warning messages displayed while compiling

2017-08-12 Thread Philippe Mathieu-Daudé
Hi Eric, On 08/12/2017 08:41 AM, Eric Blake wrote: Here's an idea: Instead of using struct ip6 { ... } QEMU_PACKED, use struct ip6 { ... }; QEMU_BUG_ON(sizeof(struct ip6) != 32); so that the compiler explicitly chokes if it introduced any padding, and then we know all our accesses are

Re: [Qemu-devel] SLIRP warning messages displayed while compiling

2017-08-12 Thread Eric Blake
On 08/12/2017 06:47 AM, Samuel Thibault wrote: > Eric Blake, on sam. 12 août 2017 06:41:30 -0500, wrote: >> Here's an idea: Instead of using struct ip6 { ... } QEMU_PACKED, use >> >> struct ip6 { >> ... >> }; >> QEMU_BUG_ON(sizeof(struct ip6) != 32); > > That's an interesting way indeed. I

Re: [Qemu-devel] SLIRP warning messages displayed while compiling

2017-08-12 Thread Samuel Thibault
Eric Blake, on sam. 12 août 2017 06:41:30 -0500, wrote: > Here's an idea: Instead of using struct ip6 { ... } QEMU_PACKED, use > > struct ip6 { > ... > }; > QEMU_BUG_ON(sizeof(struct ip6) != 32); That's an interesting way indeed. I however wonder whether there may be not-so-uncommon systems

Re: [Qemu-devel] SLIRP warning messages displayed while compiling

2017-08-12 Thread Eric Blake
On 08/12/2017 06:29 AM, Samuel Thibault wrote: >> >> Alignment is architecture-dependent, and the compiler >> can't know the alignment requirements for every >> architecture. > > Sure. True, but we can at least guess alignments that don't require padding, and then be told by the compiler if our

Re: [Qemu-devel] SLIRP warning messages displayed while compiling

2017-08-12 Thread Samuel Thibault
Peter Maydell, on sam. 12 août 2017 12:18:16 +0100, wrote: > On 12 August 2017 at 12:04, Samuel Thibault wrote: > > Peter Maydell, on sam. 12 août 2017 11:53:20 +0100, wrote: > >> The utility of the warning is that it means you get told > >> about stuff that might break

Re: [Qemu-devel] SLIRP warning messages displayed while compiling

2017-08-12 Thread Peter Maydell
On 12 August 2017 at 12:04, Samuel Thibault wrote: > Peter Maydell, on sam. 12 août 2017 11:53:20 +0100, wrote: >> The utility of the warning is that it means you get told >> about stuff that might break on other architectures. > > Sure, I understand that. But here all

Re: [Qemu-devel] SLIRP warning messages displayed while compiling

2017-08-12 Thread Samuel Thibault
Peter Maydell, on sam. 12 août 2017 11:53:20 +0100, wrote: > The utility of the warning is that it means you get told > about stuff that might break on other architectures. Sure, I understand that. But here all fields are aligned on their size inside the packed structure. So there can't be

Re: [Qemu-devel] SLIRP warning messages displayed while compiling

2017-08-12 Thread Peter Maydell
On 11 August 2017 at 22:58, Samuel Thibault wrote: > Hello, > > Programmingkid, on jeu. 10 août 2017 16:44:19 -0400, wrote: >> While compiling I saw these error messages: >> >> slirp/ip6_icmp.c:79:32: warning: taking address of packed member 'ip_src' of >> class or >>

Re: [Qemu-devel] SLIRP warning messages displayed while compiling

2017-08-11 Thread Samuel Thibault
Hello, Programmingkid, on jeu. 10 août 2017 16:44:19 -0400, wrote: > While compiling I saw these error messages: > > slirp/ip6_icmp.c:79:32: warning: taking address of packed member 'ip_src' of > class or > structure 'ip6' may result in an unaligned pointer value >

[Qemu-devel] SLIRP warning messages displayed while compiling

2017-08-10 Thread Programmingkid
Host: Mac OS 10.12.5 Compiler: Apple LLVM version 8.1.0 (clang-802.0.42) Command used: ./configure --target-list=ppc-softmmu,i386-softmmu && make -j 4 While compiling I saw these error messages: slirp/ip6_icmp.c:79:32: warning: taking address of packed member 'ip_src' of class or