This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Possible variadic macro bug

[Get raw message]
Peter Seebach wrote:-

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

No, that's a constraint violation, since # must be followed by a
parameter.  Even if it weren't, the standard states that the order of
evaluation of # and ## is undefined.

> >",##" 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 #.

Is this the same as the point above?

A comma can only be pasted with what the standard calls a
"placemarker" token.

Neil.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]