misc: Add twalk_r function
Commit Message
* Joseph Myers:
> I'm seeing (at least with GCC 8):
>
> tst-tsearch.c: In function 'walk_tree.constprop':
> tst-tsearch.c:231:3: error: 'first_list_size' may be used uninitialized in this function [-Werror=maybe-uninitialized]
> for (size_t i = 0; i < first_list_size && i < walk_trace_size (&walk_trace);
> ^~~
Huh. Sorry about that. I don't get this error, with a GCC 8.3-based
compiler.
It's arguably a test bug. Does this patch fix it for you?
It assumes that the tree is not empty, but I think this is true in this
test.
Thanks,
Florian
Comments
On Thu, 2 May 2019, Florian Weimer wrote:
> It's arguably a test bug. Does this patch fix it for you?
Yes, this fixes the testsuite build.
@@ -223,6 +223,7 @@ walk_tree (void *root, int expected_count)
size_t first_list_size;
struct walk_trace_element *first_list
= walk_trace_finalize (&walk_trace, &first_list_size);
+ TEST_VERIFY_EXIT (first_list != NULL);
walk_tree_with (root, expected_count, twalk_with_twalk_r);