macro __VAR_ARGS_ bug??
Zack Weinberg
zack@codesourcery.com
Sun Aug 4 23:26:00 GMT 2002
On Sun, Aug 04, 2002 at 04:20:48PM +0100, Neil Booth wrote:
> > I am using gcc 3.1 and I'm getting the incorrect output. Am I doing
> > something wrong or is this a bug?
>
> The behaviour you expect does seem to be what is documented, but hasn't
> been the implementation since around Sep 2000. I think it did behave
> the documented way just before then.
>
> 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.
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.
zw
More information about the Gcc-bugs
mailing list