From 6534b3e09ed23324e22a4b57382707f52e22ee81 Mon Sep 17 00:00:00 2001 From: David Carlier Date: Tue, 30 Oct 2018 13:23:43 +0000 Subject: [PATCH 1/5] Fix clang build. Some math functions require c11 standard. --- src/Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Makefile b/src/Makefile index 912cbc19..eec172d0 100644 --- a/src/Makefile +++ b/src/Makefile @@ -20,7 +20,11 @@ DEPENDENCY_TARGETS=hiredis linenoise lua NODEPS:=clean distclean # Default settings -STD=-std=c99 -pedantic -DREDIS_STATIC='' +ifneq ($(CC),clang) + STD=-std=c99 -pedantic -DREDIS_STATIC='' +else + STD=-std=c11 -pedantic -DREDIS_STATIC='' +endif WARN=-Wall -W -Wno-missing-field-initializers OPT=$(OPTIMIZATION) From a21d1522c79363d54794016d29a7b8af60c30960 Mon Sep 17 00:00:00 2001 From: David Carlier Date: Tue, 30 Oct 2018 14:34:45 +0000 Subject: [PATCH 2/5] allow flavors --- src/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Makefile b/src/Makefile index eec172d0..471d4fab 100644 --- a/src/Makefile +++ b/src/Makefile @@ -20,7 +20,7 @@ DEPENDENCY_TARGETS=hiredis linenoise lua NODEPS:=clean distclean # Default settings -ifneq ($(CC),clang) +ifeq (,$(findstring clang,$(CC))) STD=-std=c99 -pedantic -DREDIS_STATIC='' else STD=-std=c11 -pedantic -DREDIS_STATIC='' From 9d6fbf0e0019e7a2f6e11375bf01f7a02208a735 Mon Sep 17 00:00:00 2001 From: David Carlier Date: Tue, 30 Oct 2018 21:41:49 +0000 Subject: [PATCH 3/5] allow flavors --- src/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Makefile b/src/Makefile index eec172d0..471d4fab 100644 --- a/src/Makefile +++ b/src/Makefile @@ -20,7 +20,7 @@ DEPENDENCY_TARGETS=hiredis linenoise lua NODEPS:=clean distclean # Default settings -ifneq ($(CC),clang) +ifeq (,$(findstring clang,$(CC))) STD=-std=c99 -pedantic -DREDIS_STATIC='' else STD=-std=c11 -pedantic -DREDIS_STATIC='' From cf2f5e19d9e3579a37ec82e2953fb1e606ddbc59 Mon Sep 17 00:00:00 2001 From: David Carlier Date: Wed, 31 Oct 2018 09:53:07 +0000 Subject: [PATCH 4/5] tweak form feedback --- src/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Makefile b/src/Makefile index 471d4fab..321118db 100644 --- a/src/Makefile +++ b/src/Makefile @@ -23,7 +23,7 @@ NODEPS:=clean distclean ifeq (,$(findstring clang,$(CC))) STD=-std=c99 -pedantic -DREDIS_STATIC='' else - STD=-std=c11 -pedantic -DREDIS_STATIC='' + STD=-std=c99 -Wno-c11-extensions -pedantic -DREDIS_STATIC='' endif WARN=-Wall -W -Wno-missing-field-initializers OPT=$(OPTIMIZATION) From 1d9866632709e7d4256e8050e7b4ba81a61bcf71 Mon Sep 17 00:00:00 2001 From: David Carlier Date: Thu, 8 Nov 2018 10:13:52 +0000 Subject: [PATCH 5/5] only FreeBSD change/little warning addressing --- src/Makefile | 9 +++++---- src/debug.c | 2 ++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/Makefile b/src/Makefile index 321118db..2d279775 100644 --- a/src/Makefile +++ b/src/Makefile @@ -20,10 +20,11 @@ DEPENDENCY_TARGETS=hiredis linenoise lua NODEPS:=clean distclean # Default settings -ifeq (,$(findstring clang,$(CC))) - STD=-std=c99 -pedantic -DREDIS_STATIC='' -else - STD=-std=c99 -Wno-c11-extensions -pedantic -DREDIS_STATIC='' +STD=-std=c99 -pedantic -DREDIS_STATIC='' +ifneq (,$(findstring clang,$(CC))) +ifneq (,$(findstring FreeBSD,$(uname_S))) + STD+=-Wno-c11-extensions +endif endif WARN=-Wall -W -Wno-missing-field-initializers OPT=$(OPTIMIZATION) diff --git a/src/debug.c b/src/debug.c index 8cc53d92..70def3b3 100644 --- a/src/debug.c +++ b/src/debug.c @@ -1189,6 +1189,8 @@ void serverLogHexDump(int level, char *descr, void *value, size_t len) { void watchdogSignalHandler(int sig, siginfo_t *info, void *secret) { #ifdef HAVE_BACKTRACE ucontext_t *uc = (ucontext_t*) secret; +#else + (void)secret; #endif UNUSED(info); UNUSED(sig);