[hackers] [scc] Close stdout in error || Roberto E. Vargas Caballero

From: <git_AT_suckless.org>
Date: Thu, 17 Sep 2015 13:13:40 +0200 (CEST)

commit b49ee206468a789cd58b73c1012f4eab381bbb63
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
AuthorDate: Thu Sep 17 12:59:43 2015 +0200
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
CommitDate: Thu Sep 17 12:59:43 2015 +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.

diff --git a/cc1/error.c b/cc1/error.c
index ecd310d..64a4e8a 100644
--- a/cc1/error.c
+++ b/cc1/error.c
_AT_@ -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
index 661d98d..6981df0 100644
--- a/cc1/ir.md
+++ b/cc1/ir.md
_AT_@ -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 ##
 
Received on Thu Sep 17 2015 - 13:13:40 CEST

This archive was generated by hypermail 2.3.0 : Thu Sep 17 2015 - 13:24:10 CEST