From e3a245f615736d4d64bdfc4d7cbed84bd3402062 Mon Sep 17 00:00:00 2001 From: jsteube Date: Sun, 30 Oct 2016 20:39:27 +0100 Subject: [PATCH] Fix compiler warnings caused by -Wpointer-arith --- src/Makefile | 1 + src/potfile.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Makefile b/src/Makefile index 3261324d4..150e3c142 100644 --- a/src/Makefile +++ b/src/Makefile @@ -107,6 +107,7 @@ CFLAGS += -Wundef CFLAGS += -Wshadow CFLAGS += -Wmissing-declarations CFLAGS += -Wmissing-prototypes +CFLAGS += -Wpointer-arith CFLAGS += -ftrapv LFLAGS := diff --git a/src/potfile.c b/src/potfile.c index 43e357ab2..da26cea26 100644 --- a/src/potfile.c +++ b/src/potfile.c @@ -127,7 +127,7 @@ void *hc_bsearch_r (const void *key, const void *base, size_t nmemb, size_t size const size_t c = l + m; - const void *next = base + (c * size); + const char *next = (char *) base + (c * size); const int cmp = (*compar) (key, next, arg);