qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Anthony Liguori <anthony@codemonkey.ws>
To: Blue Swirl <blauwirbel@gmail.com>
Cc: Andreas Schwab <schwab@linux-m68k.org>,
	qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] Re: [PATCH 1/5] HACKING: add preprocessor rules
Date: Mon, 16 Aug 2010 13:32:31 -0500	[thread overview]
Message-ID: <4C69843F.7060103@codemonkey.ws> (raw)
In-Reply-To: <AANLkTin1B_VUpV5rHfxL=g=KHJBM88CYAx_d6pJ=Fv2D@mail.gmail.com>

On 08/16/2010 01:05 PM, Blue Swirl wrote:
> On Sun, Aug 15, 2010 at 9:27 PM, Andreas Schwab<schwab@linux-m68k.org>  wrote:
>    
>> Blue Swirl<blauwirbel@gmail.com>  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

  reply	other threads:[~2010-08-16 18:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-15 17:50 [Qemu-devel] [PATCH 1/5] HACKING: add preprocessor rules Blue Swirl
2010-08-15 21:27 ` [Qemu-devel] " Andreas Schwab
2010-08-16 18:05   ` Blue Swirl
2010-08-16 18:32     ` Anthony Liguori [this message]
2010-08-17 17:40       ` Blue Swirl

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4C69843F.7060103@codemonkey.ws \
    --to=anthony@codemonkey.ws \
    --cc=blauwirbel@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=schwab@linux-m68k.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).