macro __VAR_ARGS_ bug??

Reza Roboubi reza@linisoft.com
Mon Aug 5 01:02:00 GMT 2002


Neil Booth wrote:
> 
> Zack Weinberg wrote:-
> > [...]
> > 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?

I was trying to understand the cpp source code because I could
potentially need to use it.  So, I was just playing.  I don't feel I'll
ever have any code that needs that feature.  However, if I understand
the documentation correctly, it says that this behavior is required by
c99.  

Now, frankly, I can't understand how the c99 people required this,
_despite_ not having a remedy for doing it like gcc does it(again my
understanding of the documentation.) The gcc solution, which is the
possibility of not supplying the VAR_ARGS at all, leading to the removal
of the comma, seems much more sensible and useful. 

However, people do have the gcc extension at their disposal, and their
code looks nicer with it anyways(instead of loose commas each time the
VAR_ARGS is empty.)  So it seems there is nothing to loose if gcc
complies with c99 in this case, rather than having 2 syntactic ways to
do the same thing, namely remove the comma.  The only problem  might be
backwards compatibility, if people are already using the comma-removal
feature in the gnu89 mode.  

I just see potential flame wars over this, with people using commercial
software saying "Linux is not standards compliant."  Ideally I don't
even care about them, but here it seems easy to comply with the
standard.



More information about the Gcc-bugs mailing list