From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MRrJX-0001IR-Hx for qemu-devel@nongnu.org; Fri, 17 Jul 2009 13:33:43 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MRrJS-0001Fl-MK for qemu-devel@nongnu.org; Fri, 17 Jul 2009 13:33:42 -0400 Received: from [199.232.76.173] (port=44807 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MRrJS-0001Fc-Co for qemu-devel@nongnu.org; Fri, 17 Jul 2009 13:33:38 -0400 Received: from mx20.gnu.org ([199.232.41.8]:20268) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MRrJR-00020g-U7 for qemu-devel@nongnu.org; Fri, 17 Jul 2009 13:33:38 -0400 Received: from mail.codesourcery.com ([65.74.133.4]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MRrJQ-0005IZ-NL for qemu-devel@nongnu.org; Fri, 17 Jul 2009 13:33:37 -0400 From: Paul Brook Subject: Re: [Qemu-devel] [PATCH 2/2] Introduce macro for defining qdev properties Date: Fri, 17 Jul 2009 18:33:32 +0100 References: <1247841685-18495-1-git-send-email-aliguori@us.ibm.com> <1247841685-18495-3-git-send-email-aliguori@us.ibm.com> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200907171833.34167.paul@codesourcery.com> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Blue Swirl Cc: Anthony Liguori , qemu-devel@nongnu.org, Gerd Hoffman On Friday 17 July 2009, Blue Swirl wrote: > On Fri, Jul 17, 2009 at 5:41 PM, Anthony Liguori wrote: > > This patch introduces macros for defining qdev properties. The default > > macro is clever enough to infer the type of the structure field and to > > automatically generate a name for the property. Additional macros are > > provided that allow infered values to be overridden along with a set of > > macros to define properties with default values. > > Maybe for sake of non-GCC compatibility we should use less clever but > compatible macros, like > QDEV_PROP_NAME_DEFVAL_I32 > QDEV_PROP_NAME_DEFVAL_I64 > QDEV_PROP_NAME_DEFVAL_PTR > QDEV_PROP_NAME_DEFVAL_CHRDEV > etc? I think I agree. Using GCC extensions for error checking (e.g. DO_UPCAST) or performance (__builtin_clz) is fine, but I'm a reluctant to rely on it for correct operation. Paul