scc

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

commit d8efa5c5f4926ab97f083cba19e423dbb337d92c
parent c3a5d9f3ceb74e55f3100d83077f9ed2dff81280
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Sat,  9 Sep 2017 10:21:35 +0200

[cc1] Avoid inclusion of stdio.h in every file

Due to several definitions in cc1.h it was needed to include
stdio.h in every file of cc1, but checking that stdin is defined
we can avoid the inclusion.

Diffstat:
cc1/cc1.h | 4+++-
cc1/decl.c | 1-
cc1/expr.c | 1-
cc1/fold.c | 1-
cc1/init.c | 1-
cc1/main.c | 1-
cc1/stmt.c | 1-
cc1/target/amd64-sysv/arch.c | 1-
cc1/target/i386-sysv/arch.c | 1-
cc1/target/z80-scc/arch.c | 1-
cc1/types.c | 1-
11 files changed, 3 insertions(+), 11 deletions(-)

diff --git a/cc1/cc1.h b/cc1/cc1.h @@ -361,6 +361,7 @@ struct yystype { unsigned char token; }; +#ifdef stdin struct input { char flags; unsigned lineno; @@ -370,6 +371,7 @@ struct input { char *line, *begin, *p; struct input *next; }; +#endif /* error.c */ extern void error(char *fmt, ...); @@ -481,7 +483,7 @@ extern unsigned curctx; extern Symbol *curfun, *zero, *one; extern char *infile; extern unsigned lineno; -extern char filenam[FILENAME_MAX]; +extern char filenam[]; extern Type *voidtype, *pvoidtype, *booltype, *uchartype, *chartype, *schartype, diff --git a/cc1/decl.c b/cc1/decl.c @@ -1,6 +1,5 @@ static char sccsid[] = "@(#) ./cc1/decl.c"; #include <stdarg.h> -#include <stdio.h> #include <stdlib.h> #include <string.h> diff --git a/cc1/expr.c b/cc1/expr.c @@ -1,6 +1,5 @@ static char sccsid[] = "@(#) ./cc1/expr.c"; #include <assert.h> -#include <stdio.h> #include <stdlib.h> #include <string.h> diff --git a/cc1/fold.c b/cc1/fold.c @@ -1,6 +1,5 @@ static char sccsid[] = "@(#) ./cc1/fold.c"; #include <assert.h> -#include <stdio.h> #include <stdlib.h> #include "../inc/scc.h" diff --git a/cc1/init.c b/cc1/init.c @@ -1,6 +1,5 @@ static char sccsid[] = "@(#) ./cc1/init.c"; #include <stdint.h> -#include <stdio.h> #include <stdlib.h> #include <string.h> diff --git a/cc1/main.c b/cc1/main.c @@ -1,6 +1,5 @@ static char sccsid[] = "@(#) ./cc1/main.c"; #include <setjmp.h> -#include <stdio.h> #include <stdlib.h> #include <string.h> #include <errno.h> diff --git a/cc1/stmt.c b/cc1/stmt.c @@ -1,7 +1,6 @@ static char sccsid[] = "@(#) ./cc1/stmt.c"; #include <stddef.h> #include <setjmp.h> -#include <stdio.h> #include <cstd.h> #include "../inc/scc.h" diff --git a/cc1/target/amd64-sysv/arch.c b/cc1/target/amd64-sysv/arch.c @@ -1,5 +1,4 @@ static char sccsid[] = "@(#) ./cc1/arch/amd64-sysv/arch.c"; -#include <stdio.h> #include "../../../inc/scc.h" #include "../../cc1.h" diff --git a/cc1/target/i386-sysv/arch.c b/cc1/target/i386-sysv/arch.c @@ -1,5 +1,4 @@ static char sccsid[] = "@(#) ./cc1/arch/i386-sysv/arch.c"; -#include <stdio.h> #include "../../../inc/scc.h" #include "../../cc1.h" diff --git a/cc1/target/z80-scc/arch.c b/cc1/target/z80-scc/arch.c @@ -1,5 +1,4 @@ static char sccsid[] = "@(#) ./cc1/arch/z80/arch.c"; -#include <stdio.h> #include "../../../inc/scc.h" #include "../../cc1.h" diff --git a/cc1/types.c b/cc1/types.c @@ -1,7 +1,6 @@ static char sccsid[] = "@(#) ./cc1/types.c"; #include <assert.h> #include <inttypes.h> -#include <stdio.h> #include <stdlib.h> #include <string.h>