Possible variadic macro bug
Neil Booth
neil@daikokuya.demon.co.uk
Fri Nov 2 13:34:00 GMT 2001
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.
More information about the Gcc-bugs
mailing list