scc

simple C compiler
git clone git://git.2f30.org/scc
Log | Files | Refs | README | LICENSE

commit b49ee206468a789cd58b73c1012f4eab381bbb63
parent 5ac24b9b6ee631848b5a2cc893ba7381ccf9c87f
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Thu, 17 Sep 2015 12:59:43 +0200

Close stdout in error

Printing ???? is a non sense because the backend must check
for this sequence, and it means a low level read routine is needed,
but a better approach can be close the output stream.

Diffstat:
Mcc1/error.c | 2+-
Mcc1/ir.md | 2+-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/cc1/error.c b/cc1/error.c @@ -26,7 +26,7 @@ warn_error(int flag, char *fmt, va_list va) if (flag < 0) { if (!failure) { failure = 1; - puts("????"); + fclose(stdout); } failure = 1; if (nerrors++ == MAXERRNUM) { diff --git a/cc1/ir.md b/cc1/ir.md @@ -10,7 +10,7 @@ The language is composed by lines, which represent statements, and fields in statements are separated by tabulators. Declaration statements begin in column 0, meanwhile expressions and control flow begin with a tabulator. When the front end detects an error -it emits ???? and stop of emitting anything else. +it closes the output stream. ## Types ##