commit 547ebe46cda4213bc8ab71406096c9d415bbffe7
Author:     Quentin Rameau <[email protected]>
AuthorDate: Wed Feb 15 18:15:25 2017 +0100
Commit:     Quentin Rameau <[email protected]>
CommitDate: Fri Feb 17 10:51:22 2017 +0100

    [libc] Remove -o option
    
    It's not necessary, the user can use shell redirection if needed.

diff --git a/cc1/cc1.h b/cc1/cc1.h
index 704c37e..a5ad280 100644
--- a/cc1/cc1.h
+++ b/cc1/cc1.h
@@ -478,7 +478,7 @@ extern int lexmode, namespace;
 extern int onlycpp, onlyheader;
 extern unsigned curctx;
 extern Symbol *curfun, *zero, *one;
-extern char *infile, *outfile;
+extern char *infile;
 extern unsigned lineno;
 extern char filenam[FILENAME_MAX];
 
diff --git a/cc1/main.c b/cc1/main.c
index e901ce0..d84f682 100644
--- a/cc1/main.c
+++ b/cc1/main.c
@@ -10,7 +10,7 @@ static char sccsid[] = "@(#) ./cc1/main.c";
 #include "../inc/cc.h"
 #include "cc1.h"
 
-char *argv0, *infile, *outfile;
+char *argv0, *infile;
 
 int warnings;
 jmp_buf recover;
@@ -22,13 +22,6 @@ int onlycpp, onlyheader;
 extern int failure;
 
 static void
-clean(void)
-{
-       if (failure && outfile)
-               remove(outfile);
-}
-
-static void
 defmacro(char *macro)
 {
        char *p = strchr(macro, '=');
@@ -54,7 +47,6 @@ main(int argc, char *argv[])
        char *cp;
        int i;
 
-       atexit(clean);
        ilex();
        icpp();
        icode();
@@ -79,9 +71,6 @@ main(int argc, char *argv[])
        case 'd':
                DBGON();
                break;
-       case 'o':
-               outfile = EARGF(usage());
-               break;
        case 'w':
                warnings = 1;
                break;
@@ -92,9 +81,6 @@ main(int argc, char *argv[])
        if (argc > 1)
                usage();
 
-       if (outfile && !freopen(outfile, "w", stdout))
-               die("error opening output: %s", strerror(errno));
-
        for (i = 0; i < uflags.n; ++i)
                undefmacro(uflags.s[i]);
 

Reply via email to