summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--shared/c-rbtree/src/c-rbtree.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/shared/c-rbtree/src/c-rbtree.h b/shared/c-rbtree/src/c-rbtree.h
index d1941185fb..d4d0fe45c0 100644
--- a/shared/c-rbtree/src/c-rbtree.h
+++ b/shared/c-rbtree/src/c-rbtree.h
@@ -61,7 +61,8 @@ typedef struct CRBTree CRBTree;
struct CRBNode {
union {
unsigned long __parent_and_flags;
- alignas(4) char __dmmy_for_struct_alignment;
+ /* enforce >=4-byte alignment for @__parent_and_flags */
+ alignas(4) unsigned char __align_dummy;
};
CRBNode *left;
CRBNode *right;
@@ -92,7 +93,11 @@ void c_rbnode_unlink_stale(CRBNode *n);
* To initialize an RB-Tree, set it to NULL / all zero.
*/
struct CRBTree {
- CRBNode *root;
+ union {
+ CRBNode *root;
+ /* enforce >=4-byte alignment for @root */
+ alignas(4) unsigned char __align_dummy;
+ };
};
#define C_RBTREE_INIT {}