PATCH: avoid -Werror for parser-generated sources

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



We've been bitten repeatedly by changes in lex and yacc resulting in
new compiler warnings.  Now that we build with -Werror this can result
in broken builds.  Since we have little control over what lex and yacc
generate, just filter out -Werror when compiling their .c files.

 checkpolicy/Makefile     |    4 ++--
 libsemanage/src/Makefile |   12 ++++++++++++
 2 files changed, 14 insertions(+), 2 deletions(-)

Index: trunk/libsemanage/src/Makefile
===================================================================
--- trunk/libsemanage/src/Makefile	(revision 2811)
+++ trunk/libsemanage/src/Makefile	(working copy)
@@ -71,6 +71,18 @@
 %.lo:  %.c
 	$(CC) $(CFLAGS) -fPIC -DSHARED -c -o $@ $<
 
+conf-parse.o:  conf-parse.c
+	$(CC) $(filter-out -Werror, $(CFLAGS)) -c -o $@ $<
+
+conf-parse.lo:  conf-parse.c
+	$(CC) $(filter-out -Werror, $(CFLAGS)) -fPIC -DSHARED -c -o $@ $<
+
+conf-scan.o:  conf-scan.c
+	$(CC) $(filter-out -Werror, $(CFLAGS)) -c -o $@ $<
+
+conf-scan.lo:  conf-scan.c
+	$(CC) $(filter-out -Werror, $(CFLAGS)) -fPIC -DSHARED -c -o $@ $<
+
 $(SWIGCOUT): $(SWIGIF)
 	$(SWIG) $^
 
Index: trunk/checkpolicy/Makefile
===================================================================
--- trunk/checkpolicy/Makefile	(revision 2811)
+++ trunk/checkpolicy/Makefile	(working copy)
@@ -33,10 +33,10 @@
 	$(CC) $(CFLAGS) -o $@ -c $<
 
 y.tab.o: y.tab.c
-	$(CC) $(CFLAGS) -o $@ -c $<
+	$(CC) $(filter-out -Werror, $(CFLAGS)) -o $@ -c $<
 
 lex.yy.o: lex.yy.c
-	$(CC) $(CFLAGS) -o $@ -c $<
+	$(CC) $(filter-out -Werror, $(CFLAGS)) -o $@ -c $<
 
 y.tab.c: policy_parse.y
 	$(YACC) -d policy_parse.y

--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@xxxxxxxxxxxxx with
the words "unsubscribe selinux" without quotes as the message.

[Index of Archives]     [Selinux Refpolicy]     [Linux SGX]     [Fedora Users]     [Fedora Desktop]     [Yosemite Photos]     [Yosemite Camping]     [Yosemite Campsites]     [KDE Users]     [Gnome Users]

  Powered by Linux