[hackers] [scc] [cc1] remove per-calling name different behaviour || Quentin Rameau

From: <git_AT_suckless.org>
Date: Wed, 25 Jan 2017 12:21:56 +0100 (CET)

commit 5d1e33b49e2a382979ecfca1266052e94cdf7ef0
Author: Quentin Rameau <quinq_AT_fifth.space>
AuthorDate: Wed Jan 25 12:09:40 2017 +0100
Commit: Quentin Rameau <quinq_AT_fifth.space>
CommitDate: Wed Jan 25 12:09:40 2017 +0100

    [cc1] remove per-calling name different behaviour
    
    We don't produce a cpp binary anymore, only cc1-ARCH, so we don't need
    this anymore.

diff --git a/cc1/main.c b/cc1/main.c
index baadd53..020d557 100644
--- a/cc1/main.c
+++ b/cc1/main.c
_AT_@ -15,7 +15,7 @@ char *argv0;
 int warnings;
 jmp_buf recover;
 
-static char *name, *output;
+static char *output;
 static struct items uflags;
 int onlycpp;
 
_AT_@ -44,11 +44,8 @@ defmacro(char *macro)
 static void
 usage(void)
 {
- die(!strcmp(name, "cpp") ?
- "usage: cpp [-wd] [-D def[=val]]... [-U def]... [-I dir]... "
- "[input]" :
- "usage: cc1 [-Ewd] [-D def[=val]]... [-U def]... [-I dir]... "
- "[-o output] [input]");
+ die("usage: cc1-" ARCH " [-Ewd] [-D def[=val]]... [-U def]... "
+ "[-I dir]... [-o output] [input]");
 }
 
 int
_AT_@ -61,9 +58,6 @@ main(int argc, char *argv[])
         ilex();
         icpp();
 
- /* if run as cpp, only run the preprocessor */
- name = (cp = strrchr(*argv, '/')) ? cp + 1 : *argv;
-
         ARGBEGIN {
         case 'D':
                 defmacro(EARGF(usage()));
_AT_@ -96,9 +90,6 @@ main(int argc, char *argv[])
         if (output && !freopen(output, "w", stdout))
                 die("error opening output: %s", strerror(errno));
 
- if (!strcmp(name, "cpp"))
- onlycpp = 1;
-
         for (i = 0; i < uflags.n; ++i)
                 undefmacro(uflags.s[i]);
 
Received on Wed Jan 25 2017 - 12:21:56 CET

This archive was generated by hypermail 2.3.0 : Wed Jan 25 2017 - 12:24:20 CET