From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:45265) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RuUkk-0005c4-1L for qemu-devel@nongnu.org; Mon, 06 Feb 2012 15:01:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RuUkf-0000dj-H4 for qemu-devel@nongnu.org; Mon, 06 Feb 2012 15:01:30 -0500 Received: from mail-qy0-f173.google.com ([209.85.216.173]:45085) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RuUkf-0000dP-1F for qemu-devel@nongnu.org; Mon, 06 Feb 2012 15:01:25 -0500 Received: by qcsc20 with SMTP id c20so3808595qcs.4 for ; Mon, 06 Feb 2012 12:01:23 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <4F3028D2.2060409@codemonkey.ws> References: <1328237992-14953-1-git-send-email-afaerber@suse.de> <1328237992-14953-4-git-send-email-afaerber@suse.de> <4F3028D2.2060409@codemonkey.ws> Date: Mon, 6 Feb 2012 20:01:23 +0000 Message-ID: From: Peter Maydell Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH RFC v3 03/21] qom: Introduce CPU class List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Paolo Bonzini , =?UTF-8?Q?Andreas_F=C3=A4rber?= , qemu-devel@nongnu.org On 6 February 2012 19:24, Anthony Liguori wrote: > On 02/02/2012 08:59 PM, Andreas F=C3=A4rber wrote: >> +#define CPU(obj) OBJECT_CHECK(CPU, (obj), TYPE_CPU) >> +#define CPU_CLASS(class) OBJECT_CLASS_CHECK(CPUClass, (class), TYPE_CPU= ) >> +#define CPU_GET_CLASS(obj) OBJECT_GET_CLASS(CPUClass, (obj), TYPE_CPU) >> + >> +typedef struct CPU CPU; > > If this doesn't result in a build error, then C is a worse language than = I > thought it was :-/ > > But we definitely shouldn't have a typename and macro name of the same th= ing > and expect it to work... The C standard says that function-like macros are only applied when the function-like macro name is followed by a '(' as the next preprocessing token, so this is= n't relying on any kind of gcc-specific behaviour. Whether we *want* to do it is largely a style issue :-) -- PMM