3 ms·
Could we have variadic macros with zero arguments in the standard? I'm not using any compiler that doesn't allow it.
by parenthesis 6y ago
Could we have variadic macros with zero arguments in the standard? I'm not using any compiler that doesn't allow it.
- pascal_cuoq 6y agoThe C standard description does not allow a function that does not have at least one normal argument before the variadic arguments. Conceptually, something must indicate to the function how many arguments it is supposed to request next, and with what types. Yes, you could write a function where this information is passed through a static-lifetime variable, but in practice the first mandatory argument is almost always used for that anyway.
- david2ndaccount 6y agoYou’re replying to a comment about macros, not about functions.