diff options
author | Sergey Bugaev <bugaevc@gmail.com> | 2024-03-27 19:18:31 +0300 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2024-03-27 19:46:49 +0100 |
commit | c8998d9d3d0c55f98cc4eb7110f99af9c699ed4b (patch) | |
tree | 9b0484fd67bea540131595e5b89cf0104e9b3f20 | |
parent | e4685d299c3933403c16ada60c6f65f579c3b479 (diff) | |
download | gnumach-c8998d9d3d0c55f98cc4eb7110f99af9c699ed4b.tar.gz gnumach-c8998d9d3d0c55f98cc4eb7110f99af9c699ed4b.tar.bz2 gnumach-c8998d9d3d0c55f98cc4eb7110f99af9c699ed4b.zip |
kern/rdxtree: Fix undefined behavior
Initializing a variable with itself is undefined, and GCC 14 rightfully
produces a warning about the variable being used (to initialize itself)
prior to initialization. X15 sets the variables to 0 instead, so do the
same in Mach.
Message-ID: <20240327161841.95685-8-bugaevc@gmail.com>
-rw-r--r-- | kern/rdxtree.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/kern/rdxtree.c b/kern/rdxtree.c index a23d6e7e..6d03710c 100644 --- a/kern/rdxtree.c +++ b/kern/rdxtree.c @@ -437,7 +437,7 @@ rdxtree_insert_common(struct rdxtree *tree, rdxtree_key_t key, void *ptr, void ***slotp) { struct rdxtree_node *node, *prev; - unsigned int height, shift, index = index; + unsigned int height, shift, index = 0; int error; assert(ptr != NULL); @@ -513,7 +513,7 @@ rdxtree_insert_alloc_common(struct rdxtree *tree, void *ptr, rdxtree_key_t *keyp, void ***slotp) { struct rdxtree_node *node, *prev; - unsigned int height, shift, index = index; + unsigned int height, shift, index = 0; rdxtree_key_t key; int error; |