From 95423cc26cbf06fa0f14322e8cac96e814c4f65f 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 912cbc19f..eec172d0e 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 2c3f9cd66898778a5c3e6a94b0fa1ea6fad48cb6 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 eec172d0e..471d4fab4 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 725fbf78ee0114f1b9f06eefca6cc797aa0620e6 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 eec172d0e..471d4fab4 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 266f2e89008ceddcb6deb1aa336cf6a68781eb86 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 471d4fab4..321118dbb 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 7cfbba40f0b0eba1beb081904ce1f3928a68a7fb 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 321118dbb..2d279775d 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 8cc53d92f..70def3b30 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);