From patchwork Thu Sep 21 01:50:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Yi Yang X-Patchwork-Id: 29040 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id F0E84199B0; Thu, 21 Sep 2017 03:54:59 +0200 (CEST) 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) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Sep 2017 18:54:57 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos; i="5.42,423,1500966000"; d="scan'208"; a="1016806705" Received: from unknown (HELO localhost.localdomain.bj.intel.com) ([10.240.224.185]) by orsmga003.jf.intel.com with ESMTP; 20 Sep 2017 18:54:56 -0700 From: Yi Yang To: dev@dpdk.org Cc: harry.van.haaren@intel.com, Yi Yang Date: Thu, 21 Sep 2017 09:50:43 +0800 Message-Id: <1505958643-21203-1-git-send-email-yi.y.yang@intel.com> X-Mailer: git-send-email 2.1.0 MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v2] service: fix build error "ids uninitialized in rte_service_map_lcore_set" X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list 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 Acked-by: Harry van Haaren --- 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)