From 45b53ef93135b240989d88b065f7ee7f12a95bfb Mon Sep 17 00:00:00 2001 From: zinc Date: Wed, 14 Oct 2026 16:14:01 +0330 Subject: zc0: reject .u on a typed parameter with the compiler's message --- src/tools/zc0.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/tools') diff --git a/src/tools/zc0.c b/src/tools/zc0.c index fc60ddf..20dcbf9 100644 --- a/src/tools/zc0.c +++ b/src/tools/zc0.c @@ -831,7 +831,10 @@ static void fndef(int ret, int rstr) /* rstr: the return type is bstr */ if (!accept(")")) { do { t = 0; ptag = 0; pstr[np & 15] = 0; - if (optype() >= 0) { t = ptag == 1 ? 1 : ptag == 2 ? 2 : 0; pstr[np & 15] = ptstr; } /* the type is read and dropped */ + if (optype() >= 0) { /* the type is read and dropped */ + if (ptag == 3) die("a parameter tag is .m or .d"); /* the compiler's message: .u is only a return tag */ + t = ptag == 1 ? 1 : ptag == 2 ? 2 : 0; pstr[np & 15] = ptstr; + } else if (accept(".")) { /* .m name, .d name */ if (is("m")) t = 1; else if (is("d")) t = 2; else die("a parameter tag is .m or .d"); next(); -- cgit v1.2.3