From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from dpdk.org (dpdk.org [92.243.14.124])
	by inbox.dpdk.org (Postfix) with ESMTP id CCCF1A00C3;
	Thu, 14 May 2020 00:57:55 +0200 (CEST)
Received: from [92.243.14.124] (localhost [127.0.0.1])
	by dpdk.org (Postfix) with ESMTP id 2E88C1D638;
	Thu, 14 May 2020 00:57:55 +0200 (CEST)
Received: from mga17.intel.com (mga17.intel.com [192.55.52.151])
 by dpdk.org (Postfix) with ESMTP id D3E721D629
 for <dev@dpdk.org>; Thu, 14 May 2020 00:57:53 +0200 (CEST)
IronPort-SDR: iCfKp3blOulsUfY6aCxNkLo+EQVrEQilPx457xgJUjVlZxfVcRcriEc2kgekRJ/316TowE24Hd
 +XkMbcrpLHZQ==
X-Amp-Result: SKIPPED(no attachment in message)
X-Amp-File-Uploaded: False
Received: from orsmga003.jf.intel.com ([10.7.209.27])
 by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;
 13 May 2020 15:57:52 -0700
IronPort-SDR: 5NnuVLMDMWwHWJ3EYiTDCNP2ZXI26UYsYFueL1IGDWKN8zbAS58E1jaesfLn6cK9qSjOcQcao8
 QnwYx7GDy8rQ==
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.73,389,1583222400"; d="scan'208";a="262642764"
Received: from win-dpdk-pallavi.jf.intel.com (HELO localhost.localdomain)
 ([10.166.188.75])
 by orsmga003.jf.intel.com with ESMTP; 13 May 2020 15:57:52 -0700
From: Pallavi Kadam <pallavi.kadam@intel.com>
To: dev@dpdk.org,
	thomas@monjalon.net
Cc: ranjit.menon@intel.com,
	pallavi.kadam@intel.com
Date: Wed, 13 May 2020 15:53:41 -0700
Message-Id: <20200513225341.7620-1-pallavi.kadam@intel.com>
X-Mailer: git-send-email 2.18.0.windows.1
Subject: [dpdk-dev] [PATCH] eal: fix warnings on Windows
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>

This patch fixes bunch of warnings when compiling on Windows
such as the use of an unsafe string function (strerror),
[-Wunused-const-variable] in getopt.c and
[-Wunused-variable], [-Wunused-function] in eal_common_options.c

Signed-off-by: Ranjit Menon <ranjit.menon@intel.com>
Signed-off-by: Pallavi Kadam <pallavi.kadam@intel.com>
Tested-by: Pallavi Kadam <pallavi.kadam@intel.com>
---
 lib/librte_eal/common/eal_common_options.c | 6 +++++-
 lib/librte_eal/windows/getopt.c            | 4 ++--
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/lib/librte_eal/common/eal_common_options.c b/lib/librte_eal/common/eal_common_options.c
index 8f2cbd1c6..2efbf59e4 100644
--- a/lib/librte_eal/common/eal_common_options.c
+++ b/lib/librte_eal/common/eal_common_options.c
@@ -115,8 +115,10 @@ struct shared_driver {
 static struct shared_driver_list solib_list =
 TAILQ_HEAD_INITIALIZER(solib_list);
 
+#ifndef RTE_EXEC_ENV_WINDOWS
 /* Default path of external loadable drivers */
 static const char *default_solib_dir = RTE_EAL_PMD_PATH;
+#endif
 
 /*
  * Stringified version of solib path used by dpdk-pmdinfo.py
@@ -329,6 +331,7 @@ eal_plugin_add(const char *path)
 	return 0;
 }
 
+#ifndef RTE_EXEC_ENV_WINDOWS
 static int
 eal_plugindir_init(const char *path)
 {
@@ -362,6 +365,7 @@ eal_plugindir_init(const char *path)
 	/* XXX this ignores failures from readdir() itself */
 	return (dent == NULL) ? 0 : -1;
 }
+#endif
 
 int
 eal_plugins_init(void)
@@ -394,8 +398,8 @@ eal_plugins_init(void)
 		}
 
 	}
-	return 0;
 #endif
+	return 0;
 }
 
 /*
diff --git a/lib/librte_eal/windows/getopt.c b/lib/librte_eal/windows/getopt.c
index 170c9b5e0..a08f7c109 100644
--- a/lib/librte_eal/windows/getopt.c
+++ b/lib/librte_eal/windows/getopt.c
@@ -25,8 +25,8 @@ int	opterr = 1;		/* if error message should be printed */
 int	optind = 1;		/* index into parent argv vector */
 int	optopt = '?';		/* character checked for validity */
 
-static void pass(void) {}
-#define warnx(a, ...) pass()
+static void pass(const char *a) {(void) a; }
+#define warnx(a, ...) pass(a)
 
 #define PRINT_ERROR	((opterr) && (*options != ':'))
 
-- 
2.18.0.windows.1