macro __VAR_ARGS_ bug??
Zack Weinberg
zack@codesourcery.com
Tue Aug 6 00:26:00 GMT 2002
On Tue, Aug 06, 2002 at 07:54:54AM +0100, Neil Booth wrote:
> Here's an alternative version that
>
> 1) Retains the comma if there is at least 2 macro parameters
> 2) If there is just the variadic parameter, then it retains the
> comma only in standards-conforming mode (any standard).
>
> This means that the existing uses of the extension and the testsuite
> won't break, but that we retain standards compliance.
I like it. It needs to be documented, though, and we might consider
throwing a warning about the variable behavior in somewhere -
needn't be on by default; perhaps -pedantic.
> +/* macro_arg->first is this to indicate that the variable arguments
> + were omitted entirely, and that if pasted with a comma, the comma
> + should be swallowed. */
> +#define SWALLOW_PASTED_COMMA NULL
I'm not sure about this from a style POV. I think I would rather you
just use NULL and comment the point of use.
> /* Nonzero means give all the error messages the ANSI standard requires. */
> + unsigned char std;
> +
> + /* Nonzero means give all the error messages the ANSI standard requires. */
> unsigned char pedantic;
Why do these have the same comment?
zw
More information about the Gcc-bugs
mailing list