From 7ee038a55d70ffb94139869acf423ebe0dd52b70 Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Mon, 15 Apr 2024 01:03:20 -0700 Subject: decl: Improve check for function prototype consisting of only 'void' --- decl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/decl.c b/decl.c index 1fc57af..40ae579 100644 --- a/decl.c +++ b/decl.c @@ -629,8 +629,10 @@ declaratortypes(struct scope *s, struct list *result, char **name, bool allowabs break; } } - if (t->u.func.params->type->kind == TYPEVOID && !t->u.func.params->next) + if (t->u.func.nparam == 1 && !t->u.func.isvararg && t->u.func.params->type->kind == TYPEVOID && !t->u.func.params->name) { t->u.func.params = NULL; + t->u.func.nparam = 0; + } break; case TRPAREN: break; -- cgit v1.2.3