From 57c5c9b6a6a4e1eb685b3f850f51a25d407284da Mon Sep 17 00:00:00 2001
From: smlng <s@mlng.net>
Date: Tue, 31 Oct 2017 11:51:37 +0100
Subject: [PATCH] make: enable Wall and Wextra by default, and optionally
 Wpedantic

---
 Makefile.include              | 8 +++++++-
 drivers/nrf24l01p/nrf24l01p.c | 4 ----
 tests/trickle/main.c          | 6 ++----
 3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/Makefile.include b/Makefile.include
index 146ab78581..4be97ec5ca 100644
--- a/Makefile.include
+++ b/Makefile.include
@@ -123,7 +123,13 @@ endif
 WERROR ?= 1
 export WERROR
 ifeq ($(WERROR),1)
-  CFLAGS += -Werror
+  CFLAGS += -Wall -Werror -Wextra
+endif
+
+WPEDANTIC ?= 0
+export WPEDANTIC
+ifeq ($(WPEDANTIC),1)
+    CFLAGS += -Wpedantic -pedantic-errors
 endif
 
 ifneq (10,$(if ${RIOT_VERSION},1,0)$(if ${__RIOTBUILD_FLAG},1,0))
diff --git a/drivers/nrf24l01p/nrf24l01p.c b/drivers/nrf24l01p/nrf24l01p.c
index 7d2dba8709..f8ecf5d66f 100644
--- a/drivers/nrf24l01p/nrf24l01p.c
+++ b/drivers/nrf24l01p/nrf24l01p.c
@@ -354,10 +354,6 @@ int nrf24l01p_set_payload_width(const nrf24l01p_t *dev,
             return -1;
     }
 
-    if (width == 0) {
-        return -1;
-    }
-
     if (width > 32) {
         width = 32;
     }
diff --git a/tests/trickle/main.c b/tests/trickle/main.c
index 4a90e94aa5..cf3cf2a9aa 100644
--- a/tests/trickle/main.c
+++ b/tests/trickle/main.c
@@ -53,16 +53,14 @@ static void callback(void *args)
     return;
 }
 
-static trickle_t trickle;
+static trickle_t trickle = { .callback = { .func = &callback,
+                                           .args = NULL } };
 
 int main(void)
 {
     msg_t msg;
     unsigned counter = 0;
 
-    trickle.callback.func = &callback;
-    trickle.callback.args = NULL;
-
     trickle_start(sched_active_pid, &trickle, TRICKLE_MSG, TR_IMIN,
                   TR_IDOUBLINGS, TR_REDCONST);
 
-- 
GitLab