Consider the following code snippet:
#include
#include
void display(int num, ...) {
char c;
int j;
va_list ptr;
another case that the others forgot to mention are pointer types, critical is NULL
in particular. Since this could expand to 0
or (void*)0
(or some other weird things) you will not know if the compiler puts an int
or a void*
in the list. Since these can have different width, this can lead to annoying bugs.