From: Yi Yang Date: Thu, 21 Sep 2017 01:50:43 +0000 (+0800) Subject: service: fix build with gcc 4.9 X-Git-Tag: spdx-start~2152 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=ca13673513b656e632d5b348de2aa448b55ba9de;p=dpdk.git service: fix build with gcc 4.9 Some compilers detect this error: error: ‘ids[0]’ may be used uninitialized in this function ret = rte_service_map_lcore_set(i, ids[lcore_iter], 1); It can be reproduced very easily on Fedora 21 with gcc-4.9.2-6.fc21.x86_64. Fixes: 21698354c832 ("service: introduce service cores concept") Cc: stable@dpdk.org Signed-off-by: Yi Yang Acked-by: Harry van Haaren --- diff --git a/lib/librte_eal/common/rte_service.c b/lib/librte_eal/common/rte_service.c index 43716bb6d2..e598e16396 100644 --- a/lib/librte_eal/common/rte_service.c +++ b/lib/librte_eal/common/rte_service.c @@ -431,7 +431,7 @@ rte_service_start_with_defaults(void) uint32_t count = rte_service_get_count(); int32_t lcore_iter = 0; - uint32_t ids[RTE_MAX_LCORE]; + uint32_t ids[RTE_MAX_LCORE] = {0}; int32_t lcore_count = rte_service_lcore_list(ids, RTE_MAX_LCORE); if (lcore_count == 0)