DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] eal: fix warnings on Windows
@ 2020-05-13 22:53 Pallavi Kadam
  2020-05-14  0:43 ` Dmitry Kozlyuk
                   ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: Pallavi Kadam @ 2020-05-13 22:53 UTC (permalink / raw)
  To: dev, thomas; +Cc: ranjit.menon, pallavi.kadam

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


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [dpdk-dev] [PATCH] eal: fix warnings on Windows
  2020-05-13 22:53 [dpdk-dev] [PATCH] eal: fix warnings on Windows Pallavi Kadam
@ 2020-05-14  0:43 ` Dmitry Kozlyuk
  2020-05-14  1:24   ` Ranjit Menon
  2020-05-14  8:02 ` Thomas Monjalon
  2020-05-14 20:39 ` [dpdk-dev] [PATCH v2] " Pallavi Kadam
  2 siblings, 1 reply; 18+ messages in thread
From: Dmitry Kozlyuk @ 2020-05-14  0:43 UTC (permalink / raw)
  To: Pallavi Kadam; +Cc: dev, thomas, ranjit.menon

On Wed, 13 May 2020 15:53:41 -0700 Pallavi Kadam wrote:
> 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

This causes different warnings:

In file included from ../../../lib/librte_eal/common/eal_common_options.c:21:
At top level:
../../../lib/librte_eal/windows/include/dirent.h:529:1: warning: 'closedir' defined but not used [-Wunused-function]
  529 | closedir(DIR *dirp)
      | ^~~~~~~~
../../../lib/librte_eal/windows/include/dirent.h:447:1: warning: 'readdir' defined but not used [-Wunused-function]
  447 | readdir(DIR *dirp)
      | ^~~~~~~
../../../lib/librte_eal/windows/include/dirent.h:377:1: warning: 'opendir' defined but not used [-Wunused-function]
  377 | opendir(const char *dirname)
      | ^~~~~~~

Suggesting not to include <dirent.h> to this file on Windows (this
makes dirent.h unused in EAL, but other code will require it later).

>  
>  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 != ':'))
>  

Testing with MinGW-w64 (Ubuntu 19.10, package 6.0.0-3, GCC 9.2.1)
reveals additional warnings. Never mind fixing them in a separate patch
to avoid blocking this one. For the record:

../../../lib/librte_eal/common/eal_common_thread.c:180:25: warning: unused parameter 'attr' [-Wunused-parameter]

../../../lib/librte_eal/windows/eal_lcore.c:30:1: warning: old-style function definition [-Wold-style-definition]
   30 | eal_create_cpu_map()

../../../lib/librte_eal/windows/eal_thread.c:149:29: warning: cast between incompatible function types from '__attribute__((noreturn)) void * (*)(void *)' to 'DWORD (*)(void *)' {aka 'long unsigned int (*)(void * '} [-Wcast-function-type]
  149 |  th = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)eal_thread_loop,

../../../lib/librte_eal/windows/eal.c:144:1: warning: 'optnone' attribute directive ignored [-Wattributes]

../../../lib/librte_eal/common/eal_common_options.c: In function 'eal_adjust_config':
../../../lib/librte_eal/windows/include/sched.h:63:55: warning: 'default_set._bits[1]' may be used uninitialized in this function [-Wmaybe-uninitialized]
   63 |   (dst)->_bits[_i] = (src1)->_bits[_i] & (src2)->_bits[_i]; \

--
Dmitry Kozlyuk

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [dpdk-dev] [PATCH] eal: fix warnings on Windows
  2020-05-14  0:43 ` Dmitry Kozlyuk
@ 2020-05-14  1:24   ` Ranjit Menon
  0 siblings, 0 replies; 18+ messages in thread
From: Ranjit Menon @ 2020-05-14  1:24 UTC (permalink / raw)
  To: Dmitry Kozlyuk, Pallavi Kadam; +Cc: dev, thomas

On 5/13/2020 5:43 PM, Dmitry Kozlyuk wrote:
> On Wed, 13 May 2020 15:53:41 -0700 Pallavi Kadam wrote:
>> 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
> 
> This causes different warnings:
> 
> In file included from ../../../lib/librte_eal/common/eal_common_options.c:21:
> At top level:
> ../../../lib/librte_eal/windows/include/dirent.h:529:1: warning: 'closedir' defined but not used [-Wunused-function]
>    529 | closedir(DIR *dirp)
>        | ^~~~~~~~
> ../../../lib/librte_eal/windows/include/dirent.h:447:1: warning: 'readdir' defined but not used [-Wunused-function]
>    447 | readdir(DIR *dirp)
>        | ^~~~~~~
> ../../../lib/librte_eal/windows/include/dirent.h:377:1: warning: 'opendir' defined but not used [-Wunused-function]
>    377 | opendir(const char *dirname)
>        | ^~~~~~~
> 
> Suggesting not to include <dirent.h> to this file on Windows (this
> makes dirent.h unused in EAL, but other code will require it later).
> 

Yes. We saw this too and realized that if we put a #ifndef 
RTE_EXEC_ENV_WINDOWS around the #include of dirent.h, it would render 
the file as being unused. But, I think it makes sense to do it - better 
than having these warnings.

>>   
>>   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 != ':'))
>>   
> 
> Testing with MinGW-w64 (Ubuntu 19.10, package 6.0.0-3, GCC 9.2.1)
> reveals additional warnings. Never mind fixing them in a separate patch
> to avoid blocking this one. For the record:
> 
> ../../../lib/librte_eal/common/eal_common_thread.c:180:25: warning: unused parameter 'attr' [-Wunused-parameter]
> 
> ../../../lib/librte_eal/windows/eal_lcore.c:30:1: warning: old-style function definition [-Wold-style-definition]
>     30 | eal_create_cpu_map()
> 
> ../../../lib/librte_eal/windows/eal_thread.c:149:29: warning: cast between incompatible function types from '__attribute__((noreturn)) void * (*)(void *)' to 'DWORD (*)(void *)' {aka 'long unsigned int (*)(void * '} [-Wcast-function-type]
>    149 |  th = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)eal_thread_loop,
> 
> ../../../lib/librte_eal/windows/eal.c:144:1: warning: 'optnone' attribute directive ignored [-Wattributes]
> 
> ../../../lib/librte_eal/common/eal_common_options.c: In function 'eal_adjust_config':
> ../../../lib/librte_eal/windows/include/sched.h:63:55: warning: 'default_set._bits[1]' may be used uninitialized in this function [-Wmaybe-uninitialized]
>     63 |   (dst)->_bits[_i] = (src1)->_bits[_i] & (src2)->_bits[_i]; \
> 
> --
> Dmitry Kozlyuk
> 

Yes, we can address this in a separate patch.

ranjit m.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [dpdk-dev] [PATCH] eal: fix warnings on Windows
  2020-05-13 22:53 [dpdk-dev] [PATCH] eal: fix warnings on Windows Pallavi Kadam
  2020-05-14  0:43 ` Dmitry Kozlyuk
@ 2020-05-14  8:02 ` Thomas Monjalon
  2020-05-14 17:46   ` Ranjit Menon
  2020-05-14 20:39 ` [dpdk-dev] [PATCH v2] " Pallavi Kadam
  2 siblings, 1 reply; 18+ messages in thread
From: Thomas Monjalon @ 2020-05-14  8:02 UTC (permalink / raw)
  To: Pallavi Kadam; +Cc: dev, ranjit.menon, dmitry.kozliuk

14/05/2020 00:53, Pallavi Kadam:
> 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>
> ---
> +#ifndef RTE_EXEC_ENV_WINDOWS
>  static int
>  eal_plugindir_init(const char *path)

Why disabling the plugin mechanism?
Can we make it working instead?

PS: When sending patches for Windows, please Cc
the official Windows maintainers and Dmitry Kozliuk.



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [dpdk-dev] [PATCH] eal: fix warnings on Windows
  2020-05-14  8:02 ` Thomas Monjalon
@ 2020-05-14 17:46   ` Ranjit Menon
  0 siblings, 0 replies; 18+ messages in thread
From: Ranjit Menon @ 2020-05-14 17:46 UTC (permalink / raw)
  To: Thomas Monjalon, Pallavi Kadam; +Cc: dev, dmitry.kozliuk

On 5/14/2020 1:02 AM, Thomas Monjalon wrote:
> 14/05/2020 00:53, Pallavi Kadam:
>> 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>
>> ---
>> +#ifndef RTE_EXEC_ENV_WINDOWS
>>   static int
>>   eal_plugindir_init(const char *path)
> 
> Why disabling the plugin mechanism?
> Can we make it working instead?
> 

The function that is calling eal_plugindir_init() has already been 
#ifndef-ed out for Windows compilation. So, this function will never be 
called on Windows and was the cause of multiple compilation warnings.
Best to keep it disabled until we can have this implemented and working 
on Windows

> PS: When sending patches for Windows, please Cc
> the official Windows maintainers and Dmitry Kozliuk.
> 
> 

Yes. Will do.

ranjit m.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [dpdk-dev] [PATCH v2] eal: fix warnings on Windows
  2020-05-13 22:53 [dpdk-dev] [PATCH] eal: fix warnings on Windows Pallavi Kadam
  2020-05-14  0:43 ` Dmitry Kozlyuk
  2020-05-14  8:02 ` Thomas Monjalon
@ 2020-05-14 20:39 ` Pallavi Kadam
  2020-05-15 19:20   ` Dmitry Kozlyuk
                     ` (2 more replies)
  2 siblings, 3 replies; 18+ messages in thread
From: Pallavi Kadam @ 2020-05-14 20:39 UTC (permalink / raw)
  To: dev, thomas
  Cc: Harini.Ramakrishnan, ranjit.menon, dmitry.kozliuk,
	Narcisa.Vasile, pallavi.kadam

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

v2 changes:
	Excluded dirent.h file on Windows temporarily.
	(This file will stay on Windows for later use)

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 | 8 +++++++-
 lib/librte_eal/windows/getopt.c            | 4 ++--
 2 files changed, 9 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..0546beb3a 100644
--- a/lib/librte_eal/common/eal_common_options.c
+++ b/lib/librte_eal/common/eal_common_options.c
@@ -18,7 +18,9 @@
 #endif
 #include <sys/types.h>
 #include <sys/stat.h>
+#ifndef RTE_EXEC_ENV_WINDOWS
 #include <dirent.h>
+#endif
 
 #include <rte_string_fns.h>
 #include <rte_eal.h>
@@ -115,8 +117,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 +333,7 @@ eal_plugin_add(const char *path)
 	return 0;
 }
 
+#ifndef RTE_EXEC_ENV_WINDOWS
 static int
 eal_plugindir_init(const char *path)
 {
@@ -362,6 +367,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 +400,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


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [dpdk-dev] [PATCH v2] eal: fix warnings on Windows
  2020-05-14 20:39 ` [dpdk-dev] [PATCH v2] " Pallavi Kadam
@ 2020-05-15 19:20   ` Dmitry Kozlyuk
  2020-05-18 22:08   ` Narcisa Ana Maria Vasile
  2020-05-28 23:14   ` [dpdk-dev] [PATCH v3 0/2] Fix Windows compiler warnings Pallavi Kadam
  2 siblings, 0 replies; 18+ messages in thread
From: Dmitry Kozlyuk @ 2020-05-15 19:20 UTC (permalink / raw)
  To: Pallavi Kadam
  Cc: dev, thomas, Harini.Ramakrishnan, ranjit.menon, Narcisa.Vasile

On Thu, 14 May 2020 13:39:45 -0700
Pallavi Kadam <pallavi.kadam@intel.com> wrote:

> 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
> 
> v2 changes:
> 	Excluded dirent.h file on Windows temporarily.
> 	(This file will stay on Windows for later use)
> 
> 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>
> ---
[snip]

Tested-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>

--
Dmitry Kozlyuk

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [dpdk-dev] [PATCH v2] eal: fix warnings on Windows
  2020-05-14 20:39 ` [dpdk-dev] [PATCH v2] " Pallavi Kadam
  2020-05-15 19:20   ` Dmitry Kozlyuk
@ 2020-05-18 22:08   ` Narcisa Ana Maria Vasile
  2020-05-28 23:14   ` [dpdk-dev] [PATCH v3 0/2] Fix Windows compiler warnings Pallavi Kadam
  2 siblings, 0 replies; 18+ messages in thread
From: Narcisa Ana Maria Vasile @ 2020-05-18 22:08 UTC (permalink / raw)
  To: Pallavi Kadam
  Cc: dev, thomas, Harini.Ramakrishnan, ranjit.menon, dmitry.kozliuk,
	Narcisa.Vasile, ocardona

On Thu, May 14, 2020 at 01:39:45PM -0700, Pallavi Kadam wrote:
> 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
> 
> v2 changes:
> 	Excluded dirent.h file on Windows temporarily.
> 	(This file will stay on Windows for later use)
> 
> 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>
> ---
> 
Glad to see those warnings gone!
Tested with clang, FYI it looks like there's only one warning left. We use "attr" in the pthread_create call, but in the pthread_create macro definition we ignore the attribute parameter.
[13/30] Compiling C object lib/76b5a35@@rte_eal@sta/librte_eal_common_eal_common_thread.c.obj.
../lib/librte_eal/common/eal_common_thread.c:180:25: warning: unused parameter 'attr' [-Wunused-parameter]
                const pthread_attr_t *attr,
                                      ^
1 warning generated.

Otherwise,
Acked-by: Narcisa Vasile <navasile@linux.microsoft.com>

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [dpdk-dev] [PATCH v3 0/2] Fix Windows compiler warnings
  2020-05-14 20:39 ` [dpdk-dev] [PATCH v2] " Pallavi Kadam
  2020-05-15 19:20   ` Dmitry Kozlyuk
  2020-05-18 22:08   ` Narcisa Ana Maria Vasile
@ 2020-05-28 23:14   ` Pallavi Kadam
  2020-05-28 23:14     ` [dpdk-dev] [PATCH v3 1/2] eal: fix warnings on Windows Pallavi Kadam
                       ` (2 more replies)
  2 siblings, 3 replies; 18+ messages in thread
From: Pallavi Kadam @ 2020-05-28 23:14 UTC (permalink / raw)
  To: dev, thomas
  Cc: ranjit.menon, dmitry.kozliuk, Narcisa.Vasile, tbashar,
	Harini.Ramakrishnan, pallavi.kadam

This patchset fixes all the Windows compiler warnings generated using
Clang and MinGW compiler.
Henceforth, all the warnings will be treated as errors on Windows.

v3 changes:
	Fixed pthread warning
	Added -Werror on Windows
	Fixed MinGW warnings

v2 changes:
	Excluded dirent.h file on Windows temporarily.
	(This file will stay on Windows for later use)


Pallavi Kadam (2):
  eal: fix warnings on Windows
  build: treat warning as an error on Windows

 config/meson.build                         | 4 ++++
 lib/librte_eal/common/eal_common_options.c | 8 +++++++-
 lib/librte_eal/windows/eal.c               | 2 +-
 lib/librte_eal/windows/eal_lcore.c         | 2 +-
 lib/librte_eal/windows/eal_thread.c        | 3 ++-
 lib/librte_eal/windows/getopt.c            | 4 ++--
 lib/librte_eal/windows/include/pthread.h   | 6 ++++--
 7 files changed, 21 insertions(+), 8 deletions(-)

-- 
2.18.0.windows.1


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [dpdk-dev] [PATCH v3 1/2] eal: fix warnings on Windows
  2020-05-28 23:14   ` [dpdk-dev] [PATCH v3 0/2] Fix Windows compiler warnings Pallavi Kadam
@ 2020-05-28 23:14     ` Pallavi Kadam
  2020-06-11 16:14       ` Thomas Monjalon
  2020-05-28 23:14     ` [dpdk-dev] [PATCH v3 2/2] build: treat warning as an error " Pallavi Kadam
  2020-06-11 19:50     ` [dpdk-dev] [PATCH v4] eal: fix warnings " Pallavi Kadam
  2 siblings, 1 reply; 18+ messages in thread
From: Pallavi Kadam @ 2020-05-28 23:14 UTC (permalink / raw)
  To: dev, thomas
  Cc: ranjit.menon, dmitry.kozliuk, Narcisa.Vasile, tbashar,
	Harini.Ramakrishnan, pallavi.kadam

Fixed bunch of warnings when compiling using clang on Windows
such as the use of an unsafe string function (strerror),
[-Wunused-variable], [-Wunused-function] in eal_common_options.c
[-Wunused-const-variable] in getopt.c and [-Wunused-parameter]
in eal_common_thread.c.
Also fixed warnings generated using Mingw:
[-Werror=old-style-definition], [-Werror=cast-function-type] and
[-Werror=attributes]

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 | 8 +++++++-
 lib/librte_eal/windows/eal.c               | 2 +-
 lib/librte_eal/windows/eal_lcore.c         | 2 +-
 lib/librte_eal/windows/eal_thread.c        | 3 ++-
 lib/librte_eal/windows/getopt.c            | 4 ++--
 lib/librte_eal/windows/include/pthread.h   | 6 ++++--
 6 files changed, 17 insertions(+), 8 deletions(-)

diff --git a/lib/librte_eal/common/eal_common_options.c b/lib/librte_eal/common/eal_common_options.c
index 8f2cbd1c6..0546beb3a 100644
--- a/lib/librte_eal/common/eal_common_options.c
+++ b/lib/librte_eal/common/eal_common_options.c
@@ -18,7 +18,9 @@
 #endif
 #include <sys/types.h>
 #include <sys/stat.h>
+#ifndef RTE_EXEC_ENV_WINDOWS
 #include <dirent.h>
+#endif
 
 #include <rte_string_fns.h>
 #include <rte_eal.h>
@@ -115,8 +117,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 +333,7 @@ eal_plugin_add(const char *path)
 	return 0;
 }
 
+#ifndef RTE_EXEC_ENV_WINDOWS
 static int
 eal_plugindir_init(const char *path)
 {
@@ -362,6 +367,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 +400,8 @@ eal_plugins_init(void)
 		}
 
 	}
-	return 0;
 #endif
+	return 0;
 }
 
 /*
diff --git a/lib/librte_eal/windows/eal.c b/lib/librte_eal/windows/eal.c
index d084606a6..a34e519ea 100644
--- a/lib/librte_eal/windows/eal.c
+++ b/lib/librte_eal/windows/eal.c
@@ -139,7 +139,7 @@ eal_log_level_parse(int argc, char **argv)
 }
 
 /* Parse the argument given in the command line of the application */
-__attribute__((optnone)) static int
+static int
 eal_parse_args(int argc, char **argv)
 {
 	int opt, ret;
diff --git a/lib/librte_eal/windows/eal_lcore.c b/lib/librte_eal/windows/eal_lcore.c
index 82ee45413..b36f0a83b 100644
--- a/lib/librte_eal/windows/eal_lcore.c
+++ b/lib/librte_eal/windows/eal_lcore.c
@@ -27,7 +27,7 @@ static struct _wcpu_map {
  * Create a map of all processors and associated cores on the system
  */
 void
-eal_create_cpu_map()
+eal_create_cpu_map(void)
 {
 	wcpu_map.total_procs =
 		GetActiveProcessorCount(ALL_PROCESSOR_GROUPS);
diff --git a/lib/librte_eal/windows/eal_thread.c b/lib/librte_eal/windows/eal_thread.c
index e149199a6..008df6a43 100644
--- a/lib/librte_eal/windows/eal_thread.c
+++ b/lib/librte_eal/windows/eal_thread.c
@@ -146,7 +146,8 @@ eal_thread_create(pthread_t *thread)
 {
 	HANDLE th;
 
-	th = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)eal_thread_loop,
+	th = CreateThread(NULL, 0,
+		(LPTHREAD_START_ROUTINE)(ULONG_PTR)eal_thread_loop,
 						NULL, 0, (LPDWORD)thread);
 	if (!th)
 		return -1;
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 != ':'))
 
diff --git a/lib/librte_eal/windows/include/pthread.h b/lib/librte_eal/windows/include/pthread.h
index 0bbed5c3b..e2274cf4e 100644
--- a/lib/librte_eal/windows/include/pthread.h
+++ b/lib/librte_eal/windows/include/pthread.h
@@ -45,7 +45,7 @@ typedef SYNCHRONIZATION_BARRIER pthread_barrier_t;
 #define pthread_getaffinity_np(thread, size, cpuset) \
 	eal_get_thread_affinity_mask(thread, (unsigned long *) cpuset)
 #define pthread_create(threadid, threadattr, threadfunc, args) \
-	eal_create_thread(threadid, threadfunc, args)
+	eal_create_thread(threadid, threadattr, threadfunc, args)
 
 static inline int
 eal_set_thread_affinity_mask(pthread_t threadid, unsigned long *cpuset)
@@ -70,8 +70,10 @@ eal_get_thread_affinity_mask(pthread_t threadid, unsigned long *cpuset)
 }
 
 static inline int
-eal_create_thread(void *threadid, void *threadfunc, void *args)
+eal_create_thread(void *threadid, const void *threadattr, void *threadfunc,
+		void *args)
 {
+	RTE_SET_USED(threadattr);
 	HANDLE hThread;
 	hThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)threadfunc,
 		args, 0, (LPDWORD)threadid);
-- 
2.18.0.windows.1


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [dpdk-dev] [PATCH v3 2/2] build: treat warning as an error on Windows
  2020-05-28 23:14   ` [dpdk-dev] [PATCH v3 0/2] Fix Windows compiler warnings Pallavi Kadam
  2020-05-28 23:14     ` [dpdk-dev] [PATCH v3 1/2] eal: fix warnings on Windows Pallavi Kadam
@ 2020-05-28 23:14     ` Pallavi Kadam
  2020-06-11 16:12       ` Thomas Monjalon
  2020-06-11 19:50     ` [dpdk-dev] [PATCH v4] eal: fix warnings " Pallavi Kadam
  2 siblings, 1 reply; 18+ messages in thread
From: Pallavi Kadam @ 2020-05-28 23:14 UTC (permalink / raw)
  To: dev, thomas
  Cc: ranjit.menon, dmitry.kozliuk, Narcisa.Vasile, tbashar,
	Harini.Ramakrishnan, pallavi.kadam

Added -Werror in meson file to consider all the warnings
as errors on Windows.

Signed-off-by: Pallavi Kadam <pallavi.kadam@intel.com>
Reviewed-by: Ranjit Menon <ranjit.menon@intel.com>
---
 config/meson.build | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/config/meson.build b/config/meson.build
index 43ab11310..c3c1c0c4e 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -208,6 +208,10 @@ warning_flags = [
 	'-Wno-packed-not-aligned',
 	'-Wno-missing-field-initializers'
 ]
+# add -Werror to treat warnings as errors on Windows
+if is_windows
+	warning_flags += '-Werror'
+endif
 if cc.get_id() == 'gcc' and cc.version().version_compare('>=10.0')
 # FIXME: Bugzilla 396
 	warning_flags += '-Wno-zero-length-bounds'
-- 
2.18.0.windows.1


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [dpdk-dev] [PATCH v3 2/2] build: treat warning as an error on Windows
  2020-05-28 23:14     ` [dpdk-dev] [PATCH v3 2/2] build: treat warning as an error " Pallavi Kadam
@ 2020-06-11 16:12       ` Thomas Monjalon
  2020-06-11 18:54         ` Kadam, Pallavi
  0 siblings, 1 reply; 18+ messages in thread
From: Thomas Monjalon @ 2020-06-11 16:12 UTC (permalink / raw)
  To: Pallavi Kadam
  Cc: dev, ranjit.menon, dmitry.kozliuk, Narcisa.Vasile, tbashar,
	Harini.Ramakrishnan, bruce.richardson

29/05/2020 01:14, Pallavi Kadam:
> Added -Werror in meson file to consider all the warnings
> as errors on Windows.
> 
> Signed-off-by: Pallavi Kadam <pallavi.kadam@intel.com>
> Reviewed-by: Ranjit Menon <ranjit.menon@intel.com>
> ---
> --- a/config/meson.build
> +++ b/config/meson.build
> +# add -Werror to treat warnings as errors on Windows
> +if is_windows
> +	warning_flags += '-Werror'
> +endif

This should be not needed.
When configuring meson in a CI, we are supposed to use
--werror as it is done in devtools/test-meson-builds.sh.




^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [dpdk-dev] [PATCH v3 1/2] eal: fix warnings on Windows
  2020-05-28 23:14     ` [dpdk-dev] [PATCH v3 1/2] eal: fix warnings on Windows Pallavi Kadam
@ 2020-06-11 16:14       ` Thomas Monjalon
  2020-06-11 18:55         ` Kadam, Pallavi
  0 siblings, 1 reply; 18+ messages in thread
From: Thomas Monjalon @ 2020-06-11 16:14 UTC (permalink / raw)
  To: Harini.Ramakrishnan, Pallavi Kadam, navasile
  Cc: dev, ranjit.menon, dmitry.kozliuk, Narcisa.Vasile, tbashar, talshn, fady

29/05/2020 01:14, Pallavi Kadam:
> Fixed bunch of warnings when compiling using clang on Windows
> such as the use of an unsafe string function (strerror),
> [-Wunused-variable], [-Wunused-function] in eal_common_options.c
> [-Wunused-const-variable] in getopt.c and [-Wunused-parameter]
> in eal_common_thread.c.
> Also fixed warnings generated using Mingw:
> [-Werror=old-style-definition], [-Werror=cast-function-type] and
> [-Werror=attributes]
> 
> 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>

Tested-by is useless if you are the author of the patch.

>  lib/librte_eal/common/eal_common_options.c | 8 +++++++-
>  lib/librte_eal/windows/eal.c               | 2 +-
>  lib/librte_eal/windows/eal_lcore.c         | 2 +-
>  lib/librte_eal/windows/eal_thread.c        | 3 ++-
>  lib/librte_eal/windows/getopt.c            | 4 ++--
>  lib/librte_eal/windows/include/pthread.h   | 6 ++++--
>  6 files changed, 17 insertions(+), 8 deletions(-)

There were some changes since v2 which were not reviewed.
Someone please?



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [dpdk-dev] [PATCH v3 2/2] build: treat warning as an error on Windows
  2020-06-11 16:12       ` Thomas Monjalon
@ 2020-06-11 18:54         ` Kadam, Pallavi
  0 siblings, 0 replies; 18+ messages in thread
From: Kadam, Pallavi @ 2020-06-11 18:54 UTC (permalink / raw)
  To: Thomas Monjalon
  Cc: dev, ranjit.menon, dmitry.kozliuk, Narcisa.Vasile, tbashar,
	Harini.Ramakrishnan, bruce.richardson



On 6/11/2020 9:12 AM, Thomas Monjalon wrote:
> 29/05/2020 01:14, Pallavi Kadam:
>> Added -Werror in meson file to consider all the warnings
>> as errors on Windows.
>>
>> Signed-off-by: Pallavi Kadam <pallavi.kadam@intel.com>
>> Reviewed-by: Ranjit Menon <ranjit.menon@intel.com>
>> ---
>> --- a/config/meson.build
>> +++ b/config/meson.build
>> +# add -Werror to treat warnings as errors on Windows
>> +if is_windows
>> +	warning_flags += '-Werror'
>> +endif
> 
> This should be not needed.
> When configuring meson in a CI, we are supposed to use
> --werror as it is done in devtools/test-meson-builds.sh.
> 
> 
> 
Ok, will fix this in v4.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [dpdk-dev] [PATCH v3 1/2] eal: fix warnings on Windows
  2020-06-11 16:14       ` Thomas Monjalon
@ 2020-06-11 18:55         ` Kadam, Pallavi
  0 siblings, 0 replies; 18+ messages in thread
From: Kadam, Pallavi @ 2020-06-11 18:55 UTC (permalink / raw)
  To: Thomas Monjalon, Harini.Ramakrishnan, navasile
  Cc: dev, ranjit.menon, dmitry.kozliuk, Narcisa.Vasile, tbashar, talshn, fady



On 6/11/2020 9:14 AM, Thomas Monjalon wrote:
> 29/05/2020 01:14, Pallavi Kadam:
>> Fixed bunch of warnings when compiling using clang on Windows
>> such as the use of an unsafe string function (strerror),
>> [-Wunused-variable], [-Wunused-function] in eal_common_options.c
>> [-Wunused-const-variable] in getopt.c and [-Wunused-parameter]
>> in eal_common_thread.c.
>> Also fixed warnings generated using Mingw:
>> [-Werror=old-style-definition], [-Werror=cast-function-type] and
>> [-Werror=attributes]
>>
>> 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>
> 
> Tested-by is useless if you are the author of the patch.
> 
Sorry for this, will remove the tag in v4.

>>   lib/librte_eal/common/eal_common_options.c | 8 +++++++-
>>   lib/librte_eal/windows/eal.c               | 2 +-
>>   lib/librte_eal/windows/eal_lcore.c         | 2 +-
>>   lib/librte_eal/windows/eal_thread.c        | 3 ++-
>>   lib/librte_eal/windows/getopt.c            | 4 ++--
>>   lib/librte_eal/windows/include/pthread.h   | 6 ++++--
>>   6 files changed, 17 insertions(+), 8 deletions(-)
> 
> There were some changes since v2 which were not reviewed.
> Someone please?
> 
> 

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [dpdk-dev] [PATCH v4] eal: fix warnings on Windows
  2020-05-28 23:14   ` [dpdk-dev] [PATCH v3 0/2] Fix Windows compiler warnings Pallavi Kadam
  2020-05-28 23:14     ` [dpdk-dev] [PATCH v3 1/2] eal: fix warnings on Windows Pallavi Kadam
  2020-05-28 23:14     ` [dpdk-dev] [PATCH v3 2/2] build: treat warning as an error " Pallavi Kadam
@ 2020-06-11 19:50     ` Pallavi Kadam
  2020-06-11 20:18       ` Narcisa Ana Maria Vasile
  2 siblings, 1 reply; 18+ messages in thread
From: Pallavi Kadam @ 2020-06-11 19:50 UTC (permalink / raw)
  To: dev, thomas
  Cc: ranjit.menon, dmitry.kozliuk, Narcisa.Vasile, tbashar,
	Harini.Ramakrishnan, talshn, fady, pallavi.kadam

Fixed bunch of warnings when compiling using clang on Windows
such as the use of an unsafe string function (strerror),
[-Wunused-variable], [-Wunused-function] in eal_common_options.c
[-Wunused-const-variable] in getopt.c and [-Wunused-parameter]
in eal_common_thread.c.
Also fixed warnings generated using Mingw:
[-Werror=old-style-definition], [-Werror=cast-function-type] and
[-Werror=attributes]

v4 changes:
	Removed -Werror that was added on Windows in v3
	Removed self 'Tested-by' line

v3 changes:
	Fixed pthread warning
	Added -Werror on Windows
	Fixed MinGW warnings

v2 changes:
	Excluded dirent.h file on Windows temporarily.
	(This file will stay on Windows for later use)

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

diff --git a/lib/librte_eal/common/eal_common_options.c b/lib/librte_eal/common/eal_common_options.c
index 8f2cbd1c6..0546beb3a 100644
--- a/lib/librte_eal/common/eal_common_options.c
+++ b/lib/librte_eal/common/eal_common_options.c
@@ -18,7 +18,9 @@
 #endif
 #include <sys/types.h>
 #include <sys/stat.h>
+#ifndef RTE_EXEC_ENV_WINDOWS
 #include <dirent.h>
+#endif
 
 #include <rte_string_fns.h>
 #include <rte_eal.h>
@@ -115,8 +117,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 +333,7 @@ eal_plugin_add(const char *path)
 	return 0;
 }
 
+#ifndef RTE_EXEC_ENV_WINDOWS
 static int
 eal_plugindir_init(const char *path)
 {
@@ -362,6 +367,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 +400,8 @@ eal_plugins_init(void)
 		}
 
 	}
-	return 0;
 #endif
+	return 0;
 }
 
 /*
diff --git a/lib/librte_eal/windows/eal.c b/lib/librte_eal/windows/eal.c
index d084606a6..a34e519ea 100644
--- a/lib/librte_eal/windows/eal.c
+++ b/lib/librte_eal/windows/eal.c
@@ -139,7 +139,7 @@ eal_log_level_parse(int argc, char **argv)
 }
 
 /* Parse the argument given in the command line of the application */
-__attribute__((optnone)) static int
+static int
 eal_parse_args(int argc, char **argv)
 {
 	int opt, ret;
diff --git a/lib/librte_eal/windows/eal_lcore.c b/lib/librte_eal/windows/eal_lcore.c
index 82ee45413..b36f0a83b 100644
--- a/lib/librte_eal/windows/eal_lcore.c
+++ b/lib/librte_eal/windows/eal_lcore.c
@@ -27,7 +27,7 @@ static struct _wcpu_map {
  * Create a map of all processors and associated cores on the system
  */
 void
-eal_create_cpu_map()
+eal_create_cpu_map(void)
 {
 	wcpu_map.total_procs =
 		GetActiveProcessorCount(ALL_PROCESSOR_GROUPS);
diff --git a/lib/librte_eal/windows/eal_thread.c b/lib/librte_eal/windows/eal_thread.c
index 4c1e31c58..3dd56519c 100644
--- a/lib/librte_eal/windows/eal_thread.c
+++ b/lib/librte_eal/windows/eal_thread.c
@@ -140,7 +140,8 @@ eal_thread_create(pthread_t *thread)
 {
 	HANDLE th;
 
-	th = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)eal_thread_loop,
+	th = CreateThread(NULL, 0,
+		(LPTHREAD_START_ROUTINE)(ULONG_PTR)eal_thread_loop,
 						NULL, 0, (LPDWORD)thread);
 	if (!th)
 		return -1;
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 != ':'))
 
diff --git a/lib/librte_eal/windows/include/pthread.h b/lib/librte_eal/windows/include/pthread.h
index 0bbed5c3b..e2274cf4e 100644
--- a/lib/librte_eal/windows/include/pthread.h
+++ b/lib/librte_eal/windows/include/pthread.h
@@ -45,7 +45,7 @@ typedef SYNCHRONIZATION_BARRIER pthread_barrier_t;
 #define pthread_getaffinity_np(thread, size, cpuset) \
 	eal_get_thread_affinity_mask(thread, (unsigned long *) cpuset)
 #define pthread_create(threadid, threadattr, threadfunc, args) \
-	eal_create_thread(threadid, threadfunc, args)
+	eal_create_thread(threadid, threadattr, threadfunc, args)
 
 static inline int
 eal_set_thread_affinity_mask(pthread_t threadid, unsigned long *cpuset)
@@ -70,8 +70,10 @@ eal_get_thread_affinity_mask(pthread_t threadid, unsigned long *cpuset)
 }
 
 static inline int
-eal_create_thread(void *threadid, void *threadfunc, void *args)
+eal_create_thread(void *threadid, const void *threadattr, void *threadfunc,
+		void *args)
 {
+	RTE_SET_USED(threadattr);
 	HANDLE hThread;
 	hThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)threadfunc,
 		args, 0, (LPDWORD)threadid);
-- 
2.18.0.windows.1


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [dpdk-dev] [PATCH v4] eal: fix warnings on Windows
  2020-06-11 19:50     ` [dpdk-dev] [PATCH v4] eal: fix warnings " Pallavi Kadam
@ 2020-06-11 20:18       ` Narcisa Ana Maria Vasile
  2020-06-15  9:37         ` Thomas Monjalon
  0 siblings, 1 reply; 18+ messages in thread
From: Narcisa Ana Maria Vasile @ 2020-06-11 20:18 UTC (permalink / raw)
  To: Pallavi Kadam
  Cc: dev, thomas, ranjit.menon, dmitry.kozliuk, Narcisa.Vasile,
	tbashar, Harini.Ramakrishnan, talshn, fady, ocardona

On Thu, Jun 11, 2020 at 12:50:55PM -0700, Pallavi Kadam wrote:
> Fixed bunch of warnings when compiling using clang on Windows
> such as the use of an unsafe string function (strerror),
> [-Wunused-variable], [-Wunused-function] in eal_common_options.c
> [-Wunused-const-variable] in getopt.c and [-Wunused-parameter]
> in eal_common_thread.c.
> Also fixed warnings generated using Mingw:
> [-Werror=old-style-definition], [-Werror=cast-function-type] and
> [-Werror=attributes]
> 
> v4 changes:
> 	Removed -Werror that was added on Windows in v3
> 	Removed self 'Tested-by' line
> 
> v3 changes:
> 	Fixed pthread warning
> 	Added -Werror on Windows
> 	Fixed MinGW warnings
> 
> v2 changes:
> 	Excluded dirent.h file on Windows temporarily.
> 	(This file will stay on Windows for later use)
> 
> Signed-off-by: Ranjit Menon <ranjit.menon@intel.com>
> Signed-off-by: Pallavi Kadam <pallavi.kadam@intel.com>
> ---
Tested with clang, no warnings generated.
Tested-by: Narcisa Vasile <navasile@linux.microsoft.com>
Acked-by: Narcisa Vasile <navasile@linux.microsoft.com>

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [dpdk-dev] [PATCH v4] eal: fix warnings on Windows
  2020-06-11 20:18       ` Narcisa Ana Maria Vasile
@ 2020-06-15  9:37         ` Thomas Monjalon
  0 siblings, 0 replies; 18+ messages in thread
From: Thomas Monjalon @ 2020-06-15  9:37 UTC (permalink / raw)
  To: Pallavi Kadam
  Cc: dev, ranjit.menon, dmitry.kozliuk, Narcisa.Vasile, tbashar,
	Harini.Ramakrishnan, talshn, fady, ocardona,
	Narcisa Ana Maria Vasile

11/06/2020 22:18, Narcisa Ana Maria Vasile:
> On Thu, Jun 11, 2020 at 12:50:55PM -0700, Pallavi Kadam wrote:
> > Fixed bunch of warnings when compiling using clang on Windows
> > such as the use of an unsafe string function (strerror),
> > [-Wunused-variable], [-Wunused-function] in eal_common_options.c
> > [-Wunused-const-variable] in getopt.c and [-Wunused-parameter]
> > in eal_common_thread.c.
> > Also fixed warnings generated using Mingw:
> > [-Werror=old-style-definition], [-Werror=cast-function-type] and
> > [-Werror=attributes]
> > 
> > v4 changes:
> > 	Removed -Werror that was added on Windows in v3
> > 	Removed self 'Tested-by' line
> > 
> > v3 changes:
> > 	Fixed pthread warning
> > 	Added -Werror on Windows
> > 	Fixed MinGW warnings
> > 
> > v2 changes:
> > 	Excluded dirent.h file on Windows temporarily.
> > 	(This file will stay on Windows for later use)
> > 
> > Signed-off-by: Ranjit Menon <ranjit.menon@intel.com>
> > Signed-off-by: Pallavi Kadam <pallavi.kadam@intel.com>
> > ---
> Tested with clang, no warnings generated.
> Tested-by: Narcisa Vasile <navasile@linux.microsoft.com>
> Acked-by: Narcisa Vasile <navasile@linux.microsoft.com>

Applied, thanks




^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2020-06-15  9:37 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-13 22:53 [dpdk-dev] [PATCH] eal: fix warnings on Windows Pallavi Kadam
2020-05-14  0:43 ` Dmitry Kozlyuk
2020-05-14  1:24   ` Ranjit Menon
2020-05-14  8:02 ` Thomas Monjalon
2020-05-14 17:46   ` Ranjit Menon
2020-05-14 20:39 ` [dpdk-dev] [PATCH v2] " Pallavi Kadam
2020-05-15 19:20   ` Dmitry Kozlyuk
2020-05-18 22:08   ` Narcisa Ana Maria Vasile
2020-05-28 23:14   ` [dpdk-dev] [PATCH v3 0/2] Fix Windows compiler warnings Pallavi Kadam
2020-05-28 23:14     ` [dpdk-dev] [PATCH v3 1/2] eal: fix warnings on Windows Pallavi Kadam
2020-06-11 16:14       ` Thomas Monjalon
2020-06-11 18:55         ` Kadam, Pallavi
2020-05-28 23:14     ` [dpdk-dev] [PATCH v3 2/2] build: treat warning as an error " Pallavi Kadam
2020-06-11 16:12       ` Thomas Monjalon
2020-06-11 18:54         ` Kadam, Pallavi
2020-06-11 19:50     ` [dpdk-dev] [PATCH v4] eal: fix warnings " Pallavi Kadam
2020-06-11 20:18       ` Narcisa Ana Maria Vasile
2020-06-15  9:37         ` Thomas Monjalon

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git