https://gcc.gnu.org/bugzilla/show_bug.cgi?id=33877
Harald van Dijk <harald at gigawatt dot nl> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |harald at gigawatt dot nl
--- Comment #7 from Harald van Dijk <harald at gigawatt dot nl> ---
(In reply to Alejandro Colomar from comment #6)
> Please make sure to differentiate correctly the case of 0 and 1 arguments.
>
> #define foo(...) __VA_ARGC__
> #define bar(a, ...) __VA_ARGC__
>
> foo() // 0
In C23, I believe it is not specified whether this is an invocation with 0
arguments, or with 1 empty argument, because both interpretations result in the
exact same behaviour, but this was unambiguously an invocation with 1 empty
argument in C99 through C17.
If __VA_ARGC__ should return 0 here, then the behaviour of __VA_ARGC__ needs to
be documented very carefully to be different from the number of variable
arguments supplied.