From a8eeffaef662df8e9b174b5c484df95ecdba6a9e Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Mon, 6 Sep 2021 16:00:12 +0000 Subject: c4 is freestanding now --- miniany/REQUIREMENTS | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'miniany/REQUIREMENTS') diff --git a/miniany/REQUIREMENTS b/miniany/REQUIREMENTS index 0a6076c..645bdfa 100644 --- a/miniany/REQUIREMENTS +++ b/miniany/REQUIREMENTS @@ -59,4 +59,27 @@ not implementing: you have a grammatical construct to help recognizing it. - register number for register alloation https://en.wikipedia.org/wiki/Strahler_number - +- volatile: we are not doing any optimizations for now, so volatile (as const) + can just be a ignored keyword. +- c4 freestanding + - uses some casts, the malloc ones are actually good for clarification, + the ones in memset are not so usefull (this is all because we don't + have 'void *') + - open/read/close is POSIX, we would prefer either C style file handling + (we have it in libc-freestanding.c or some stdin, stdout thingy) + - again printf and varargs, either use libc-freestanding.c or revert to + putint, putstring, putnl.. + - if (tk == '(') next(); else { printf("%d: open paren expected\n", line); exit(-1); } + => + error("open paren expected"); } + - printf("%d: compiler error tk=%d\n", line, tk); exit(-1); + - printf("could not malloc(%d) symbol area\n") => remove size, also map to error + - printf("read() returned %d\n", i); => dito + - we also print a non-sensical line, but we don't really care about this + - printf("%d: bad enum identifier %d\n", line, tk); he number 'tk' looks like + debug output here, so we drop it. + error1int is the other option (also choosen in other places) + - other cases translate by hand: + - case EXIT: /* putstring("exit("); putint(*sp); putstring(") cycle = "); putint(cycle); putnl(); */ return *sp; + - default: putstring("unknown instruction = "); putint(i); putstring("! cycle = "); putint(cycle); putnl(); return -1; + -- cgit v1.2.3-54-g00ecf