scc

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

commit e39bdf2da0218151502600e8607a1b8aa690b12f
parent 6d283bb403b52df5f45b9cb81c6a70c181e45f7c
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Sat, 28 Nov 2015 10:50:56 +0100

Merge remote-tracking branch 'origin/master'

Diffstat:
MMakefile | 2+-
Mcc1/Makefile | 3++-
Mcc1/expr.c | 4++--
Mcc2/Makefile | 3++-
4 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/Makefile b/Makefile @@ -1,4 +1,5 @@ # scc - Suckless C Compiler +.POSIX: include config.mk @@ -16,4 +17,3 @@ all clean: (cd $$i; ${MAKE} $(MAKEFLAGS) $@ || exit); \ done; -.POSIX: diff --git a/cc1/Makefile b/cc1/Makefile @@ -1,3 +1,5 @@ +.POSIX: + include ../config.mk OBJS = types.o decl.o lex.o error.o symbol.o main.o expr.o \ @@ -5,7 +7,6 @@ OBJS = types.o decl.o lex.o error.o symbol.o main.o expr.o \ all: cc1 -.POSIX: $(OBJS) : cc1.h ../inc/cc.h ../inc/sizes.h arch/$(ARCH)/arch.h diff --git a/cc1/expr.c b/cc1/expr.c @@ -1186,7 +1186,7 @@ initializer(Symbol *sym, Type *tp, int nelem) np = assignop(OINIT, varnode(sym), np); - if ((flags & (ISEXTERN|ISTYPEDEF)) != 0) { + if ((flags & (ISGLOBAL|ISLOCAL|ISPRIVATE)) != 0) { if (!np->right->constant) errorp("initializer element is not constant"); emit(OINIT, np); @@ -1196,5 +1196,5 @@ initializer(Symbol *sym, Type *tp, int nelem) } else { np->op = OASSIGN; emit(OEXPR, np); - } + } } diff --git a/cc2/Makefile b/cc2/Makefile @@ -1,10 +1,11 @@ +.POSIX: + include ../config.mk OBJS = main.o parser.o cgen.o code.o optm.o peep.o all: cc2 -.POSIX: $(OBJS): ../inc/cc.h ../inc/sizes.h cc2.h main.o: error.h