This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: Possible variadic macro bug
[Get raw message]
Peter Seebach wrote:-
> >The revised ",##__VA_ARGS__" extension in gcc 3.0 was meant to be suitable
> >for standardization (unlike the older version, which was awful and I'm
> >embarrassed it survived as long as it did). In fact, if I knew how, I
> >would have written up a formal proposal already. Perhaps you can shed
> >some light on the procedure?
>
> You contact your national body (ANSI, in the U.S., or the British standards
> organization, in the UK) and ask them to submit a Defect Report. Actually,
> this looks like a friendly enough extension to me that I might be able to
> submit a DR on it and get it accepted as correcting an unfortunate limitation.
>
> I just wish someone had caught it *before* the standard went out. Hmm.
This extension has been adopted by other compilers. The popular
Edison Design Group front end for C / C++ uses the older 2.95 version
of the ## extension to handle the comma issue (I noticed this in their
online manual). So it's not unique to GCC; clearly they felt the need
to copy the extension because their customers' code used it.
All we need is to get them to do the same token-based approach as 3.0,
and you'll have two major compilers implementing the extension 8-)
I think Zack's wording in the CPP manual is excellent; it is lucid
enough that one can easily see this extension can have no bad,
unthought-of side effects.
Neil.