Possible variadic macro bug

Peter Seebach seebs@plethora.net
Fri Nov 2 12:16:00 GMT 2001


In message <20011114103631.A25636@codesourcery.com>, Zack Weinberg writes:
>On Tue, Nov 13, 2001 at 10:21:47PM +0000, Neil Booth wrote:
>> I agree with Clive Feather's point that the use of ## is ugly because
>> it gives 2 meanings to ##; I said as much over a year ago when this
>> was discussed.  So I'm in favour of a clean replacement.  I didn't
>> like any of his three suggestions at all, though.

>Do you have a reference to what he said?

Well, he had an interesting point:
	# , ## __VA_ARGS__
Does this mean
	",__VA_ARGS__"
?

>",##" is known to work in a lot of production code and is therefore
>the safer move - but it is indeed ugly.  I don't think it is
>particularly _confusing_, though; commas can't be token-pasted with
>anything, so the notation is unambiguous.

Clive pointed out correctly that it can inside a #.

-s



More information about the Gcc-bugs mailing list