Skip to content

Commit

Permalink
Merge pull request #12505 from gschorcht/pkg/tinycbor/compilation_fix
Browse files Browse the repository at this point in the history
pkg/tinycbor: fix of compiler warnings "uninitialized variable used"
  • Loading branch information
benpicco authored Oct 27, 2019
2 parents f4a16e6 + b6b1252 commit 1a4f07a
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 3 deletions.
25 changes: 25 additions & 0 deletions pkg/tinycbor/patches/0001-fix-compilation-warning-error.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
From d53d44a42a8e9c4c72438dd48e2663ec7f717397 Mon Sep 17 00:00:00 2001
From: Gunar Schorcht <gunar@schorcht.net>
Date: Sat, 19 Oct 2019 14:02:02 +0200
Subject: [PATCH 1/1] fix compilation warning/error

---
src/cborvalidation.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/cborvalidation.c b/src/cborvalidation.c
index 08c3511..28b99c4 100644
--- a/src/cborvalidation.c
+++ b/src/cborvalidation.c
@@ -379,7 +379,7 @@ static inline CborError validate_floating_point(CborValue *it, CborType type, ui
CborError err;
int r;
double val;
- float valf;
+ float valf = 0; /* fixes the "uninitialized variable" compiler warning */
uint16_t valf16;

if (type != CborDoubleType) {
--
2.17.1

4 changes: 1 addition & 3 deletions tests/pkg_tinycbor/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ include ../Makefile.tests_common
# No 8 bit and 16 bit support yet
BOARD_BLACKLIST := arduino-duemilanove arduino-leonardo \
arduino-mega2560 arduino-nano \
arduino-uno atmega328p chronos esp32-mh-et-live-minikit \
esp32-olimex-evb esp32-wemos-lolin-d32-pro \
esp32-wroom-32 esp32-wrover-kit microduino-corerf \
arduino-uno atmega328p chronos microduino-corerf \
mega-xplained msb-430 msb-430h telosb waspmote-pro \
wsn430-v1_3b wsn430-v1_4 z1 \

Expand Down

0 comments on commit 1a4f07a

Please sign in to comment.