From 8de8b467acbca50cfd8835c20e0e379110f3b32b Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Mon, 15 Jan 2024 03:03:28 +0300 Subject: [PATCH] Fix "partly outside array bounds" warnings for GCC 12 --- btree.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/btree.h b/btree.h index c7a977a..0abe101 100644 --- a/btree.h +++ b/btree.h @@ -574,9 +574,9 @@ class btree_node { btree_node* child(int i) const { return fields_.children[i]; } btree_node** mutable_child(int i) { return &fields_.children[i]; } void set_child(int i, btree_node *c) { - *mutable_child(i) = c; - c->fields_.parent = this; - c->fields_.position = i; + reinterpret_cast(this)->children[i] = c; + reinterpret_cast(c)->parent = this; + reinterpret_cast(c)->position = i; } // Returns the position of the first value whose key is not less than k.