Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Could we have variadic macros with zero arguments in the standard? I'm not using any compiler that doesn't allow it.


The 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.


You’re replying to a comment about macros, not about functions.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: