From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=44356 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ol4U9-0001oh-Nh for qemu-devel@nongnu.org; Mon, 16 Aug 2010 14:32:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Ol4U8-00085P-KN for qemu-devel@nongnu.org; Mon, 16 Aug 2010 14:32:37 -0400 Received: from mail-yx0-f173.google.com ([209.85.213.173]:51781) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Ol4U8-00085K-By for qemu-devel@nongnu.org; Mon, 16 Aug 2010 14:32:36 -0400 Received: by yxn35 with SMTP id 35so2170468yxn.4 for ; Mon, 16 Aug 2010 11:32:35 -0700 (PDT) Message-ID: <4C69843F.7060103@codemonkey.ws> Date: Mon, 16 Aug 2010 13:32:31 -0500 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] Re: [PATCH 1/5] HACKING: add preprocessor rules References: 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: Andreas Schwab , qemu-devel On 08/16/2010 01:05 PM, Blue Swirl wrote: > On Sun, Aug 15, 2010 at 9:27 PM, Andreas Schwab wrote: > >> Blue Swirl writes: >> >> >>> +For variadic macros, stick with C99 syntax: >>> + >>> +#define DPRINTF(fmt, ...) \ >>> + do { printf("IRQ: " fmt, ## __VA_ARGS__); } while (0) >>> >> That's not C99 syntax, the combination with ## is a gcc extension. In >> C99 you cannot have an empty __VA_ARGS__. >> > That's too bad, I picked the example from one of our current macros. > Maybe just s/C99/this/ or perhaps we shouldn't specify any > non-standard syntax. > We definitely should discourage the GCC syntax [#define fn(arg...)] as it's deprecated by the new C99 syntax. Very specifically, only the '##' is an extension and it's a widely adopted one. Regards, Anthony Liguori