shithub: mc

Download patch

ref: fcc859d58857fce2701ee30abd79ed891a46c3b2
parent: af4500539de576c28d982faad6ac8b845ed236ce
author: Ori Bernstein <[email protected]>
date: Sun Nov 15 12:07:28 EST 2015

Fix build flags for Clang/Yacc

    This allows us to build with -Werror again. Thanks to Ryan
    Gonzalez.

--- a/mk/c.mk
+++ b/mk/c.mk
@@ -7,7 +7,7 @@
 _LIBPATHS=$(addprefix -l, $(patsubst lib%.a,%,$(notdir $(DEPS))))
 
 # yeah, I should probably remove -Werror, but it's nice for developing alone.
-CFLAGS += -Wall -Werror -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -g
+CFLAGS += -Wall -Werror -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wno-sign-compare -Wno-array-bounds -g
 CFLAGS += -MMD -MP -MF ${_DEPSDIR}/$(subst /,-,$*).d
 
 LIB ?= $(INSTLIB)
@@ -114,7 +114,7 @@
 %.o: %.c $(GENHDR) .deps
 	$(CC) -c $(CFLAGS) $(_LIBINCPATHS) $<
 
-.deps: 
+.deps:
 	mkdir -p $(_DEPSDIR)
 
 config.mk: configure
--- a/mk/lexyacc.mk
+++ b/mk/lexyacc.mk
@@ -1,7 +1,9 @@
 .SUFFIXES:
 
 %.h %.c: %.y
+	rm -f $*.h y.tab.h
 	yacc -d -o$*.c $<
+	[ -f y.tab.h ] && mv y.tab.h $*.h
 
 %.c: %.l
 	flex -o$*.c $<