diff options
| author | 2025-11-22 19:02:38 +0100 | |
|---|---|---|
| committer | 2025-11-22 19:02:38 +0100 | |
| commit | 2f2df5093b5e02b2cc2ad05894dc3cbb4e6fac0c (patch) | |
| tree | fca92a1a43bb608b7b75ebd3566930d548f36f1d /c | |
| parent | 5b9ae4ced98def3ab476aeee18eecc71af4f1a82 (diff) | |
c: make the warning for '()' function declarations less strict
Diffstat (limited to 'c')
| -rw-r--r-- | c/c.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -2451,7 +2451,7 @@ declarator(struct declstate *st, struct comp *cm, struct span span0) { error(&decl.span, "function cannot return function type '%ty'", decl.ty); else if (decl.ty.t == TYARRAY) error(&decl.span, "function cannot return array type '%ty'", decl.ty); - if (l->kandr && ccopt.cstd > STDC89) + if (l->kandr && ccopt.cstd > STDC89 && (ccopt.cstd >= STDC23 || ccopt.pedant)) 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); |