diff options
| author | 2025-09-14 10:12:43 +0200 | |
|---|---|---|
| committer | 2025-09-14 10:12:43 +0200 | |
| commit | 519522449252389f265dc8db40d833a0a5770b5d (patch) | |
| tree | 5e298caf16a84d840107967d75bf93e5622e19fd /c.c | |
| parent | 959ba83bf55edbb72cd3a4f4a3edf3fab2ea613f (diff) | |
frontend: warn k&r function declaration
Diffstat (limited to 'c.c')
| -rw-r--r-- | c.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -2117,6 +2117,8 @@ declarator(struct declstate *st, struct comp *cm) { error(&decl.span, "function cannot return array type", decl.ty); else if (decl.ty.t != TYVOID && isincomplete(decl.ty)) error(&decl.span, "function cannot return incomplete type (%ty)", decl.ty); + if (l->kandr && ccopt.cstd > STDC89) + warn(&l->span, "function declaration without a prototype is deprecated"); decl.ty = mkfntype(decl.ty, l->npar, l->param, l->pqual, l->kandr, l->variadic); if (l->param != declparamtmp) free(l->param); if (l->pqual != declpqualtmp) free(l->pqual); |