shithub: scc

Download patch

ref: e39bdf2da0218151502600e8607a1b8aa690b12f
parent: 6d283bb403b52df5f45b9cb81c6a70c181e45f7c
parent: e043e6aa574967384504a019ccfc1bb61fe570dc
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Sat Nov 28 05:50:56 EST 2015

Merge remote-tracking branch 'origin/master'

--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,5 @@
 # scc - Suckless C Compiler
+.POSIX:
 
 include config.mk
 
@@ -16,4 +17,3 @@
 		(cd $$i; ${MAKE} $(MAKEFLAGS) $@ || exit); \
 	done;
 
-.POSIX:
--- 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 @@
 
 all: cc1
 
-.POSIX:
 
 $(OBJS) : cc1.h ../inc/cc.h ../inc/sizes.h arch/$(ARCH)/arch.h
 
--- a/cc1/expr.c
+++ b/cc1/expr.c
@@ -1186,7 +1186,7 @@
 
 	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 @@
 	} else {
 		np->op = OASSIGN;
 		emit(OEXPR, np);
-	}	
+	}
 }
--- a/cc2/Makefile
+++ b/cc2/Makefile
@@ -1,3 +1,5 @@
+.POSIX:
+
 include ../config.mk
 
 OBJS = main.o parser.o cgen.o code.o optm.o peep.o
@@ -4,7 +6,6 @@
 
 all: cc2
 
-.POSIX:
 
 $(OBJS): ../inc/cc.h ../inc/sizes.h cc2.h
 main.o: error.h