diff mbox

libsepol: cil_lexer: make warnings non-fatal for building

Message ID 1479248467-24209-1-git-send-email-sds@tycho.nsa.gov (mailing list archive)
State Not Applicable
Headers show

Commit Message

Stephen Smalley Nov. 15, 2016, 10:21 p.m. UTC
The flex skeleton often triggers compiler warnings; make these
non-fatal for building.  We already do likewise for checkpolicy.

Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
---
 libsepol/src/Makefile | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Nicolas Iooss Nov. 15, 2016, 10:37 p.m. UTC | #1
On Tue, Nov 15, 2016 at 11:21 PM, Stephen Smalley <sds@tycho.nsa.gov> wrote:

> The flex skeleton often triggers compiler warnings; make these
> non-fatal for building.  We already do likewise for checkpolicy.
>

For information, I am using flex 2.6.1 on my system and the generated code
triggers -Wsign-compare warnings. I looked at the flex git repository and
found some patches which fix these warnings in 2.6.2 (
https://github.com/westes/flex/commits/1da19feba7c957e0f0af0c3eeadc29e8c82b0ca3).
When I backported these patches to flex 2.6.1, the generated code no longer
triggered any compiler warning.

Anyway your patch looks good to me.

Nicolas
diff mbox

Patch

diff --git a/libsepol/src/Makefile b/libsepol/src/Makefile
index 7856213..7272458 100644
--- a/libsepol/src/Makefile
+++ b/libsepol/src/Makefile
@@ -60,6 +60,12 @@  else
 endif
 
 ifneq ($(DISABLE_CIL),y)
+$(CILDIR)/src/cil_lexer.o: $(CILDIR)/src/cil_lexer.c
+	$(CC) $(filter-out -Werror, $(CFLAGS)) -fPIC -c -o $@ $<
+
+$(CILDIR)/src/cil_lexer.lo: $(CILDIR)/src/cil_lexer.c
+	$(CC) $(filter-out -Werror, $(CFLAGS)) -fPIC -DSHARED -c -o $@ $<
+
 $(CILDIR)/src/cil_lexer.c: $(CILDIR)/src/cil_lexer.l
 	$(LEX) -t $< > $@
 endif