From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MRrCM-0006Qz-Ax for qemu-devel@nongnu.org; Fri, 17 Jul 2009 13:26:18 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MRrCH-0006P3-Nc for qemu-devel@nongnu.org; Fri, 17 Jul 2009 13:26:18 -0400 Received: from [199.232.76.173] (port=41695 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MRrCH-0006Oq-GW for qemu-devel@nongnu.org; Fri, 17 Jul 2009 13:26:13 -0400 Received: from e31.co.us.ibm.com ([32.97.110.149]:33729) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MRrCH-0000Tu-3e for qemu-devel@nongnu.org; Fri, 17 Jul 2009 13:26:13 -0400 Received: from d03relay04.boulder.ibm.com (d03relay04.boulder.ibm.com [9.17.195.106]) by e31.co.us.ibm.com (8.13.1/8.13.1) with ESMTP id n6HHLDs1000831 for ; Fri, 17 Jul 2009 11:21:13 -0600 Received: from d03av04.boulder.ibm.com (d03av04.boulder.ibm.com [9.17.195.170]) by d03relay04.boulder.ibm.com (8.13.8/8.13.8/NCO v9.2) with ESMTP id n6HHQ9km207392 for ; Fri, 17 Jul 2009 11:26:09 -0600 Received: from d03av04.boulder.ibm.com (loopback [127.0.0.1]) by d03av04.boulder.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id n6HHQ9p9013799 for ; Fri, 17 Jul 2009 11:26:09 -0600 Message-ID: <4A60B42F.6070202@us.ibm.com> Date: Fri, 17 Jul 2009 12:26:07 -0500 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 2/2] Introduce macro for defining qdev properties References: <1247841685-18495-1-git-send-email-aliguori@us.ibm.com> <1247841685-18495-3-git-send-email-aliguori@us.ibm.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Blue Swirl Cc: Gerd Hoffman , qemu-devel@nongnu.org, Paul Brook 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 > If we attempt non-GCC compatibility, we should take a completely different approach. > QDEV_PROP_NAME_DEFVAL_I32 > QDEV_PROP_NAME_DEFVAL_I64 > QDEV_PROP_NAME_DEFVAL_PTR > QDEV_PROP_NAME_DEFVAL_CHRDEV > etc? > > For example, Sparse does not know about __builtin_choose_expr() and > will probably complain. > Should be possible to teach sparse about it. -- Regards, Anthony Liguori