From 5f2f69eebb77f62cb0a6c4af30a854ff2489565a Mon Sep 17 00:00:00 2001 From: Samy Al Bahra Date: Mon, 7 Mar 2011 02:23:34 +0100 Subject: [PATCH] Work-around strict aliasing issue. --- include/ck_fifo.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/ck_fifo.h b/include/ck_fifo.h index 50b5b38..f4c9d42 100644 --- a/include/ck_fifo.h +++ b/include/ck_fifo.h @@ -78,6 +78,7 @@ CK_CC_INLINE static bool ck_fifo_spsc_dequeue(struct ck_fifo_spsc *fifo, void *value) { struct ck_fifo_spsc_entry *stub, *entry; + void *store; /* * The head pointer is guaranteed to always point to a stub entry. @@ -90,7 +91,8 @@ ck_fifo_spsc_dequeue(struct ck_fifo_spsc *fifo, void *value) if (entry == NULL) return (false); - *(void **)value = ck_pr_load_ptr(&entry->value); + store = ck_pr_load_ptr(&entry->value); + ck_pr_store_ptr(value, store); ck_pr_store_ptr(&fifo->head, entry); return (true); }