This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: macro __VAR_ARGS_ bug??
Zack Weinberg wrote:-
> > Zack, is there a good reason for the documented behaviour (where
> > no argument eats the comma, but an empty argument doesn't)? At present,
> > both are eating the comma.
>
> No reason based on actual code in the wild. (It's difficult to do
> anything useful with empty arguments.) I documented the behavior
> thus, and implemented it thus, because I was trying to reconcile the
> old "delete preceding nonwhitespace sequence" extension with C99. I
> wanted to make the domain of the extension - the set of programs which
> triggered nonstandard behavior - as small as possible.
OK.
> Since 3.0 implements the documented semantics, I would prefer to
> restore them in 3.1 (well, okay, 3.2.1) and 3.3 than change the
> documentation.
It's been this way since some time in Sep 2000, way before 3.0 was
released. In other words, it worked the documented way for no more
than 3 months I guess.
Zack, does this change your mind about changing the docs rather than
the code?
Reza, do you have code that expects the comma? Or were you just
playing and noticed the inconsistency?
Neil.