From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 8CE57A052E; Mon, 9 Mar 2020 13:42:43 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 950C91C067; Mon, 9 Mar 2020 13:42:36 +0100 (CET) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id D7CD21C021 for ; Mon, 9 Mar 2020 13:42:33 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Mar 2020 05:42:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,533,1574150400"; d="scan'208";a="265243894" Received: from silpixa00400072.ir.intel.com ([10.237.222.213]) by fmsmga004.fm.intel.com with ESMTP; 09 Mar 2020 05:42:31 -0700 From: Vladimir Medvedkin To: dev@dpdk.org Cc: vladimir.medvedkin@intel.com Date: Mon, 9 Mar 2020 12:42:20 +0000 Message-Id: <1583757743-375198-2-git-send-email-vladimir.medvedkin@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1583757743-375198-1-git-send-email-vladimir.medvedkin@intel.com> References: <1583757743-375198-1-git-send-email-vladimir.medvedkin@intel.com> Subject: [dpdk-dev] [PATCH 1/4] app/testfib: fix possible uninitialized warning 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" Compiller can throw warning message for routes and lookup files. Fixes: 103809d032cd ("app/test-fib: add test application for FIB") Cc: vladimir.medvedkin@intel.com Signed-off-by: Vladimir Medvedkin --- app/test-fib/main.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/app/test-fib/main.c b/app/test-fib/main.c index 3c29ca4..aa83f76 100644 --- a/app/test-fib/main.c +++ b/app/test-fib/main.c @@ -362,7 +362,7 @@ complete_v6_addr(uint32_t *addr, uint32_t rnd, int n) static void gen_random_rt_6(struct rt_rule_6 *rt, int nh_sz) { - uint32_t i, j, k = 0; + uint32_t a, i, j, k = 0; if (config.nb_routes_per_depth[0] != 0) { memset(rt[k].addr, 0, 16); @@ -370,7 +370,7 @@ gen_random_rt_6(struct rt_rule_6 *rt, int nh_sz) rt[k++].nh = rte_rand() & get_max_nh(nh_sz); } - for (int a = 0; a < 4; a++) { + for (a = 0; a < 4; a++) { for (i = 1; i <= 32; i++) { uint32_t rnd; double edge = 0; @@ -1145,7 +1145,8 @@ int main(int argc, char **argv) { int ret, af, rt_ent_sz, lookup_ent_sz; - FILE *fr, *fl; + FILE *fr = NULL; + FILE *fl = NULL; uint8_t depth_lim; ret = rte_eal_init(argc, argv); @@ -1207,7 +1208,7 @@ main(int argc, char **argv) rte_exit(-ENOMEM, "Can not alloc lookup table\n"); /* Fill routes table */ - if (config.routes_file == NULL) { + if (fr == NULL) { if (distrib_string != NULL) ret = parse_distrib(depth_lim, config.nb_routes); else { @@ -1243,7 +1244,7 @@ main(int argc, char **argv) } /* Fill lookup table with ip's*/ - if (config.lookup_ips_file == NULL) + if (fl == NULL) gen_rnd_lookup_tbl(af); else { ret = parse_lookup(fl, af); -- 2.7.4