I want to do something similar to how, in GCC, you can do syntax checking on printf-style calls (to make sure that the argument list is actually correct for the call).
I have some functions that take a variable number of parameters. Rather than enforce what parameters are sent, I need to ensure that the last parameter passed is a NULL
, regardless of how many parameters are passed-in.
Is there a way to get GCC to do this type of syntax check during compile time?