summaryrefslogtreecommitdiff
path: root/thread_sync.c
diff options
context:
space:
mode:
authorPeter Zhu <peter@peterzhu.ca>2023-01-19 12:22:02 -0500
committerPeter Zhu <peter@peterzhu.ca>2023-01-19 12:22:02 -0500
commit8872ebec6a3edc8327b5f348656c73a52bceda4a (patch)
tree182eee51fc3b1e614c494e1debc921518ba79c92 /thread_sync.c
parent9af84c95d7349ec609789c2be9acb3aaa020bfeb (diff)
downloadruby-8872ebec6a3edc8327b5f348656c73a52bceda4a.tar.gz
Fix compilation warnings in thread_sync.c
Fixes the following compilation warnings: thread_sync.c:908:48: warning: taking address of packed member of `struct rb_queue` may result in an unaligned pointer value [-Waddress-of-packed-member] thread_sync.c:1181:48: warning: taking address of packed member of `struct rb_queue` may result in an unaligned pointer value [-Waddress-of-packed-member]
Diffstat (limited to 'thread_sync.c')
-rw-r--r--thread_sync.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/thread_sync.c b/thread_sync.c
index 09d8226dd9..9b51dc55e2 100644
--- a/thread_sync.c
+++ b/thread_sync.c
@@ -905,7 +905,7 @@ rb_queue_initialize(int argc, VALUE *argv, VALUE self)
if ((argc = rb_scan_args(argc, argv, "01", &initial)) == 1) {
initial = rb_to_array(initial);
}
- RB_OBJ_WRITE(self, UNALIGNED_MEMBER_ACCESS(&q->que), ary_buf_new());
+ RB_OBJ_WRITE(self, UNALIGNED_MEMBER_ACCESS((void *)&q->que), ary_buf_new());
ccan_list_head_init(queue_waitq(q));
if (argc == 1) {
rb_ary_concat(q->que, initial);
@@ -1178,7 +1178,7 @@ rb_szqueue_initialize(VALUE self, VALUE vmax)
rb_raise(rb_eArgError, "queue size must be positive");
}
- RB_OBJ_WRITE(self, UNALIGNED_MEMBER_ACCESS(&sq->q.que), ary_buf_new());
+ RB_OBJ_WRITE(self, UNALIGNED_MEMBER_ACCESS((void *)&sq->q.que), ary_buf_new());
ccan_list_head_init(szqueue_waitq(sq));
ccan_list_head_init(szqueue_pushq(sq));
sq->max = max;