summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 307bf74)
raw | patch | inline | side by side (parent: 307bf74)
author | Florian Forster <octo@collectd.org> | |
Wed, 17 May 2017 06:17:38 +0000 (08:17 +0200) | ||
committer | Florian Forster <octo@collectd.org> | |
Thu, 18 May 2017 08:18:01 +0000 (10:18 +0200) |
src/curl_json.c | patch | blob | history | |
src/curl_json_test.c | patch | blob | history |
diff --git a/src/curl_json.c b/src/curl_json.c
index 6b50b454de1f231f24a3a4a0890693faaee063e5..181f18bbbf29f0310ace456b99c4b2920b689673 100644 (file)
--- a/src/curl_json.c
+++ b/src/curl_json.c
db->depth = 0;
memset(&db->state, 0, sizeof(db->state));
- db->state[0].entry = &(cj_tree_entry_t){
- .type = TREE, .tree = db->tree,
- };
+
+ /* This is not a compound literal because EPEL6's GCC is not cool enough to
+ * handle anonymous unions within compound literals. */
+ cj_tree_entry_t root = {0};
+ root.type = TREE;
+ root.tree = db->tree;
+ db->state[0].entry = &root;
int status = cj_perform(db);
diff --git a/src/curl_json_test.c b/src/curl_json_test.c
index 4b9846607f794e3a95c12d171fc3fccea7b69686..e8f8f6bb3a6c3a3cb8fd436890d3ee5d419b5819 100644 (file)
--- a/src/curl_json_test.c
+++ b/src/curl_json_test.c
assert(cj_append_key(db, key) == 0);
- db->state[0].entry = &(cj_tree_entry_t){
- .type = TREE, .tree = db->tree,
- };
+ cj_tree_entry_t root = {0};
+ root.type = TREE;
+ root.tree = db->tree;
+ db->state[0].entry = &root;
cj_curl_callback(json, strlen(json), 1, db);
#if HAVE_YAJL_V2