diff options
| -rw-r--r-- | pre-process.c | 4 | ||||
| -rw-r--r-- | validation/preprocessor/preprocessor23.c | 4 |
2 files changed, 7 insertions, 1 deletions
diff --git a/pre-process.c b/pre-process.c index 74414dfe..8800dce5 100644 --- a/pre-process.c +++ b/pre-process.c @@ -296,9 +296,11 @@ static int collect_arguments(struct token *start, struct token *arglist, struct for (count = 0; count < wanted; count++) { struct argcount *p = &arglist->next->count; next = collect_arg(start, p->vararg, &what->pos, p->normal); - arglist = arglist->next->next; if (eof_token(next)) goto Eclosing; + if (p->vararg && wanted == 1 && eof_token(start->next)) + break; + arglist = arglist->next->next; args[count].arg = start->next; args[count].n_normal = p->normal; args[count].n_quoted = p->quoted; diff --git a/validation/preprocessor/preprocessor23.c b/validation/preprocessor/preprocessor23.c index 25be5085..a7784838 100644 --- a/validation/preprocessor/preprocessor23.c +++ b/validation/preprocessor/preprocessor23.c @@ -12,6 +12,9 @@ I(,) I(x,) I(,x) I(x,x) +#define J(...) ,##__VA_ARGS__ +J() +J(x) /* * check-name: Preprocessor #23 * check-command: sparse -E $file @@ -29,6 +32,7 @@ I(x,x) ,x ,x ,xx +,x * check-output-end * * check-error-start |
