Merge pull request #15173 from joscollin/wip-test-crush-warning

test/crush: silence warnings from -Walloc-size-larger-than= and -Wstringop-overflow=
This commit is contained in:
Jos Collin 2017-05-19 19:48:38 +05:30 committed by GitHub
commit 8348a13fbd

View File

@ -1054,8 +1054,10 @@ TEST(CrushWrapper, choose_args_compat) {
crush_weight_set weight_set;
weight_set.size = 1;
weight_set.weights = &weights;
crush_choose_arg choose_args[c.get_max_buckets()];
memset(choose_args, '\0', sizeof(crush_choose_arg) * c.get_max_buckets());
int maxbuckets = c.get_max_buckets();
assert(maxbuckets > 0);
crush_choose_arg choose_args[maxbuckets];
memset(choose_args, '\0', sizeof(crush_choose_arg) * maxbuckets);
choose_args[-1-id].ids_size = 0;
choose_args[-1-id].weight_set_size = 1;
choose_args[-1-id].weight_set = &weight_set;