This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: macro __VAR_ARGS_ bug??
- From: Zack Weinberg <zack at codesourcery dot com>
- To: Neil Booth <neil at daikokuya dot co dot uk>
- Cc: Reza Roboubi <reza at linisoft dot com>, gcc_bugs <gcc-bugs at gcc dot gnu dot org>
- Date: Sun, 4 Aug 2002 23:26:03 -0700
- Subject: Re: macro __VAR_ARGS_ bug??
- References: <3D4C7946.6261224E@linisoft.com> <20020804152048.GA14771@daikokuya.co.uk>
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