This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: varargs macros and ##
- To: Zack Weinberg <zack at wolery dot cumb dot org>
- Subject: Re: varargs macros and ##
- From: Bruce Korb <bkorb at sco dot COM>
- Date: Wed, 17 May 2000 11:46:34 -0700
- CC: gcc at gcc dot gnu dot org
- Organization: Santa Cruz Operations
- References: <20000517111912.J28532@wolery.cumb.org>
Zack Weinberg wrote:
> # It might be better to discard the last preprocessor token instead
> # of the last preceding sequence of non-whitespace characters; in
> # fact, we may someday change this feature to do so. We advise you...
>
> .... Now, it happens that I
> am reimplementing macro expansion, and it will be much easier for the
> reimplementation to discard the last preprocessor token. It's my
> opinion that it is definitely better to do so; the behavior is less
> surprising to the user, and much more likely to be what they wanted.
>
> Does anyone object to my changing this behavior?
Do it. If it ever gets into a C spec someday, it will certainly
be this behavior, and not the non-whitespace-gobbling behavior!
Unless, of course, it is constrained to only gobbling a single
comma. There really is not any need to gobble anything else. :-)
With such a constraint:
#define foo( x... ) ....
becomes usable. (I am aware of the lack of symmetry with the
procedure header. :)