diff options
author | Michael Forney <mforney@mforney.org> | 2024-04-15 01:03:20 -0700 |
---|---|---|
committer | Michael Forney <mforney@mforney.org> | 2024-04-15 01:23:32 -0700 |
commit | 7ee038a55d70ffb94139869acf423ebe0dd52b70 (patch) | |
tree | d0c340567f8a2295b100c6ee6205c66803310c4a | |
parent | fc05a07d20b7c5baf312faaab46247d9057233b1 (diff) |
decl: Improve check for function prototype consisting of only 'void'
-rw-r--r-- | decl.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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; |