qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [RfC PATCH 0/2] qdev/prop: type checking.


From: Gerd Hoffmann
Subject: Re: [Qemu-devel] [RfC PATCH 0/2] qdev/prop: type checking.
Date: Mon, 13 Jul 2009 21:19:55 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1b3pre) Gecko/20090513 Fedora/3.0-2.3.beta2.fc11 Lightning/1.0pre Thunderbird/3.0b2

On 07/13/09 17:36, Paul Brook wrote:
The second helps a bunch of helper macros to help creating property
declarations and converts pci.c as example.  I'm not that happy with
that one yet.  Especially I'd like to check somehow that
typeof(_state->_field) == _type.  But couldn't figure out a way to do
so.  As we are setting up static data structures we are quite limited in
what we can do here.  The typechecking trick used by the linux kernel
min/max macros can't be used for example.

Could we use a union rather than an opaque pointer for the default value?

See patch (not functional, just to show the macros).

Improves things only a little bit. We still don't have any type checking for the struct element we are writing to. We have the field offset and the type it is supposed to be. But no actual check.

cheers,
  Gerd

Attachment: 0001-qdev-prop-helper-macros.patch
Description: Text document


reply via email to

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