summaryrefslogtreecommitdiff
path: root/net-im/bitlbee/files/bitlbee-3.6-strict-aliasing.patch
diff options
context:
space:
mode:
Diffstat (limited to 'net-im/bitlbee/files/bitlbee-3.6-strict-aliasing.patch')
-rw-r--r--net-im/bitlbee/files/bitlbee-3.6-strict-aliasing.patch31
1 files changed, 31 insertions, 0 deletions
diff --git a/net-im/bitlbee/files/bitlbee-3.6-strict-aliasing.patch b/net-im/bitlbee/files/bitlbee-3.6-strict-aliasing.patch
new file mode 100644
index 000000000000..30ecff9747ee
--- /dev/null
+++ b/net-im/bitlbee/files/bitlbee-3.6-strict-aliasing.patch
@@ -0,0 +1,31 @@
+Based on upstream [1] commits:
+- 161dff8321df ("Fix error type-punned pointer warning")
+- d7b67db02aaa ("Fix error type-punned pointer warning")
+
+[1] https://github.com/json-parser/json-parser
+
+Upstream-PR: https://github.com/bitlbee/bitlbee/pull/162
+
+diff --git a/lib/json.c b/lib/json.c
+index 24288f94..2150cbaf 100644
+--- a/lib/json.c
++++ b/lib/json.c
+@@ -139,7 +139,7 @@ static int new_value
+ return 0;
+ }
+
+- value->_reserved.object_mem = (*(char **) &value->u.object.values) + values_size;
++ value->_reserved.object_mem = (void *) (((char *) value->u.object.values) + values_size);
+
+ value->u.object.length = 0;
+ break;
+@@ -406,7 +406,8 @@ json_value * json_parse_ex(json_settings * settings,
+ case json_object:
+
+ if (state.first_pass) {
+- (*(json_char **) &top->u.object.values) += string_length + 1;
++ json_char **chars = (json_char **) &top->u.object.values;
++ chars[0] += string_length + 1;
+ } else {
+ top->u.object.values [top->u.object.length].name
+ = (json_char *) top->_reserved.object_mem;