[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v5 4/6] introduce new vma archive format
From: |
Kevin Wolf |
Subject: |
Re: [Qemu-devel] [PATCH v5 4/6] introduce new vma archive format |
Date: |
Wed, 27 Feb 2013 11:46:48 +0100 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
Am 25.02.2013 um 16:12 hat Eric Blake geschrieben:
> On 02/24/2013 11:37 PM, Dietmar Maurer wrote:
> > I tried to do that, but it seems that gcc does not support sizeof in
> > preprocessor conditionals,
> > so I added a runtime check in vma_writer_create().
>
> Then you've never written a compile-time assertion, have you :) No
> preprocessor magic is needed.
>
> >
> > Do you have an example how I can add a compile-time assertion that this
> > header is a fixed size?
>
> struct foo { ... };
> struct verify_foo_size {
> char dummy[sizeof(struct foo) == 256 ? 1 : -1];
> };
Don't open-code this. We have QEMU_BUILD_BUG_ON().
Kevin
- Re: [Qemu-devel] [PATCH v5 2/6] add basic backup support to block driver, (continued)
Re: [Qemu-devel] [PATCH v5 4/6] introduce new vma archive format, Markus Armbruster, 2013/02/27
Re: [Qemu-devel] [PATCH v5 0/6] Efficient VM backup for qemu, Markus Armbruster, 2013/02/22