From 89ae583a8624fad6be4a7d1da084b0c410e4fc63 Mon Sep 17 00:00:00 2001
From: Stuart Walsh <stu@ipng.org.uk>
Date: Tue, 31 Mar 2015 12:23:03 +0100
Subject: [RFC 2/2] Fix uninitialised variable compile warning, and also fix
 unused-when-used warning

---
 json_object.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/json_object.h b/json_object.h
index 200ac40..e6c6a4f 100644
--- a/json_object.h
+++ b/json_object.h
@@ -339,8 +339,8 @@ extern void json_object_object_del(struct json_object* obj, const char *key);
 #if defined(__GNUC__) && !defined(__STRICT_ANSI__) && __STDC_VERSION__ >= 199901L
 
 # define json_object_object_foreach(obj,key,val) \
-	char *key; \
-	struct json_object *val __attribute__((__unused__)); \
+	char *key = NULL; \
+	struct json_object *val = NULL; \
 	for(struct lh_entry *entry ## key = json_object_get_object(obj)->head, *entry_next ## key = NULL; \
 		({ if(entry ## key) { \
 			key = (char*)entry ## key->k; \
-- 
2.5.0

