From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yi Yang Subject: [PATCH v2] service: fix build error "ids uninitialized in rte_service_map_lcore_set" Date: Thu, 21 Sep 2017 09:50:43 +0800 Message-ID: <1505958643-21203-1-git-send-email-yi.y.yang@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: harry.van.haaren@intel.com, Yi Yang To: dev@dpdk.org Return-path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 1B0117D4E for ; Thu, 21 Sep 2017 03:54:58 +0200 (CEST) List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" v1->v2 - Change title to more descriptive one - Add issue reproduce information to git log body On current master tree, normal DPDK make will result in the below error: error: ‘ids[0]’ may be used uninitialized in this function [-Werror=maybe-uninitialized] 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. It is fixed after applied this patch. Signed-off-by: Yi Yang --- lib/librte_eal/common/rte_service.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/librte_eal/common/rte_service.c b/lib/librte_eal/common/rte_service.c index 43716bb..e598e16 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) -- 2.1.0