From 41ed5c0dbd38a5725f35837a42bc2fd27bb4ff93 Mon Sep 17 00:00:00 2001 From: Kaspar Schleiser Date: Mon, 30 Nov 2015 02:13:11 +0100 Subject: [PATCH] pkg: microcoap: add compile warning fix --- .../0005-fix-uninitialized-variable.patch | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 pkg/microcoap/0005-fix-uninitialized-variable.patch diff --git a/pkg/microcoap/0005-fix-uninitialized-variable.patch b/pkg/microcoap/0005-fix-uninitialized-variable.patch new file mode 100644 index 0000000000..278723a3b5 --- /dev/null +++ b/pkg/microcoap/0005-fix-uninitialized-variable.patch @@ -0,0 +1,30 @@ +From ac2d404d32d96a50a779ded7ad007f15bcf2b4b0 Mon Sep 17 00:00:00 2001 +From: Kaspar Schleiser +Date: Mon, 30 Nov 2015 02:11:12 +0100 +Subject: [PATCH] fix uninitialized variable + +coap.c: In function 'coap_build': +coap.c:298:17: error: 'len' may be used uninitialized in this function +[-Werror=maybe-uninitialized] + uint8_t len, delta = 0; + ^ +--- + coap.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/coap.c b/coap.c +index ada66c2..b6b05af 100644 +--- a/coap.c ++++ b/coap.c +@@ -295,7 +295,7 @@ int coap_build(uint8_t *buf, size_t *buflen, const coap_packet_t *pkt) + for (i=0;inumopts;i++) + { + uint32_t optDelta; +- uint8_t len, delta = 0; ++ uint8_t len = 0, delta = 0; + + if (((size_t)(p-buf)) > *buflen) + return COAP_ERR_BUFFER_TOO_SMALL; +-- +2.6.2 +