diff options
| author | 2025-12-15 11:31:32 +0100 | |
|---|---|---|
| committer | 2025-12-15 11:33:21 +0100 | |
| commit | 00f38f0fa0a5eb5414a43ded779bd4df3d9aa11a (patch) | |
| tree | e3b81eea551f5a7a29bd153d79aedeba766d0992 /c | |
| parent | 068aaef0ea684ecf5f891559aa8e1dae03b8428d (diff) | |
c: error when defining function with incomplete parameter type
Diffstat (limited to 'c')
| -rw-r--r-- | c/c.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -4396,6 +4396,10 @@ docomp(struct comp *cm) fn.fnty = decl.ty; if (td->ret.t != TYVOID && isincomplete(td->ret)) error(&decl.span, "function definition with incomplete return type '%ty'", td->ret); + for (int i = 0; i < td->nmemb; ++i) { + if (td->param[i].t != TYVOID && isincomplete(td->param[i])) + error(&st.pspans[i], "parameter has incomplete type '%ty'", td->param[i]); + } fn.retty = td->ret; decl.isdef = 1; putdecl(cm, &decl); |