diff mbox

Review: [PATCH] Fix warning compiling sparse

Message ID CANeU7QnrQ8RRTbOxog-RbhbzFb3SfEadDooyz4oKMuL=_AJiyA@mail.gmail.com (mailing list archive)
State Mainlined, archived
Headers show

Commit Message

Christopher Li Oct. 13, 2016, 7:30 a.m. UTC
Fix warning compiling sparse-llvm

    -pedantic in the llvm-config --cflags cause a lot of warning.


Chris
diff mbox

Patch

From 4364726646954a88a18eacfb56a9b0389e773d06 Mon Sep 17 00:00:00 2001
From: Christopher Li <sparse@chrisli.org>
Date: Thu, 29 Sep 2016 00:38:31 -0700
Subject: [PATCH] Fix warning compiling sparse-llvm

-pedantic in the llvm-config --cflags cause a lot of warning.
---
 Makefile | 2 +-
 token.h  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index c7031af..f59993f 100644
--- a/Makefile
+++ b/Makefile
@@ -84,7 +84,7 @@  ifeq ($(shell expr "$(LLVM_VERSION)" : '[3-9]\.'),2)
 LLVM_PROGS := sparse-llvm
 $(LLVM_PROGS): LD := g++
 LLVM_LDFLAGS := $(shell $(LLVM_CONFIG) --ldflags)
-LLVM_CFLAGS := $(shell $(LLVM_CONFIG) --cflags | sed -e "s/-DNDEBUG//g")
+LLVM_CFLAGS := $(shell $(LLVM_CONFIG) --cflags | sed -e "s/-DNDEBUG//g" | sed -e "s/-pedantic//g")
 LLVM_LIBS := $(shell $(LLVM_CONFIG) --libs)
 LLVM_LIBS += $(shell $(LLVM_CONFIG) --system-libs 2>/dev/null)
 PROGRAMS += $(LLVM_PROGS)
diff --git a/token.h b/token.h
index af66b2b..f7d88eb 100644
--- a/token.h
+++ b/token.h
@@ -230,7 +230,7 @@  extern struct token * tokenize_buffer(void *, unsigned long, struct token **);
 extern void show_identifier_stats(void);
 extern struct token *preprocess(struct token *);
 
-static inline int match_op(struct token *token, int op)
+static inline int match_op(struct token *token, unsigned int op)
 {
 	return token->pos.type == TOKEN_SPECIAL && token->special == op;
 }
-- 
2.7.4