qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Eric Blake
Subject: Re: [Qemu-devel] SLIRP warning messages displayed while compiling
Date: Sat, 12 Aug 2017 07:09:48 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1

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 however wonder whether there may be
> not-so-uncommon systems where the compiler aligns some fields just for
> performance or such.

If it does, the BUG_ON will flag it, and we'll deal with it as needed
for that platform, perhaps by adding:

...
}
#ifdef WEIRD_PLATFORM
  QEMU_PACKED
#endif
 ;
QEMU_BUG_ON(...);

But as long as the BUG_ON doesn't flag anything, we can use the struct
as-is.

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

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]