patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH] eal/windows: fix token pasting build warning
@ 2021-09-13 16:55 Tal Shnaiderman
  2021-09-15 19:25 ` Dmitry Kozlyuk
  0 siblings, 1 reply; 3+ messages in thread
From: Tal Shnaiderman @ 2021-09-13 16:55 UTC (permalink / raw)
  To: dev; +Cc: thomas, pallavi.kadam, dmitry.kozliuk, navasile, dmitrym, stable

When building DPDK on Windows in debug mode the following
warning appear:

warning: token pasting of ',' and __VA_ARGS__ is a GNU extension
[-Wgnu-zero-variadic-macro-arguments] #define open(path, flags, ...)
_open(path, flags, ##__VA_ARGS__)

Modified the 'open' macro to avoid it.

Fixes: 45d62067c237 ("eal: make OS shims internal")
Cc: stable@dpdk.org

Signed-off-by: Tal Shnaiderman <talshn@nvidia.com>
---
 lib/eal/windows/include/rte_os_shim.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/eal/windows/include/rte_os_shim.h b/lib/eal/windows/include/rte_os_shim.h
index 33619745ab..eda8113662 100644
--- a/lib/eal/windows/include/rte_os_shim.h
+++ b/lib/eal/windows/include/rte_os_shim.h
@@ -25,7 +25,7 @@
 #define strncasecmp(s1, s2, count) _strnicmp(s1, s2, count)
 #endif
 
-#define open(path, flags, ...) _open(path, flags, ##__VA_ARGS__)
+#define open(...) _open(__VA_ARGS__)
 #define read(fd, buf, n) _read(fd, buf, n)
 #define write(fd, buf, n) _write(fd, buf, n)
 #define close(fd) _close(fd)
-- 
2.16.1.windows.4


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

* Re: [dpdk-stable] [PATCH] eal/windows: fix token pasting build warning
  2021-09-13 16:55 [dpdk-stable] [PATCH] eal/windows: fix token pasting build warning Tal Shnaiderman
@ 2021-09-15 19:25 ` Dmitry Kozlyuk
  2021-09-23 17:17   ` [dpdk-stable] [dpdk-dev] " Thomas Monjalon
  0 siblings, 1 reply; 3+ messages in thread
From: Dmitry Kozlyuk @ 2021-09-15 19:25 UTC (permalink / raw)
  To: Tal Shnaiderman; +Cc: dev, thomas, pallavi.kadam, navasile, dmitrym, stable

2021-09-13 19:55 (UTC+0300), Tal Shnaiderman:
> When building DPDK on Windows in debug mode the following
> warning appear:
> 
> warning: token pasting of ',' and __VA_ARGS__ is a GNU extension
> [-Wgnu-zero-variadic-macro-arguments] #define open(path, flags, ...)
> _open(path, flags, ##__VA_ARGS__)
> 
> Modified the 'open' macro to avoid it.

Nit: "Modify" (present tense should be used here).

> 
> Fixes: 45d62067c237 ("eal: make OS shims internal")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Tal Shnaiderman <talshn@nvidia.com>
> ---
>  lib/eal/windows/include/rte_os_shim.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/eal/windows/include/rte_os_shim.h b/lib/eal/windows/include/rte_os_shim.h
> index 33619745ab..eda8113662 100644
> --- a/lib/eal/windows/include/rte_os_shim.h
> +++ b/lib/eal/windows/include/rte_os_shim.h
> @@ -25,7 +25,7 @@
>  #define strncasecmp(s1, s2, count) _strnicmp(s1, s2, count)
>  #endif
>  
> -#define open(path, flags, ...) _open(path, flags, ##__VA_ARGS__)
> +#define open(...) _open(__VA_ARGS__)
>  #define read(fd, buf, n) _read(fd, buf, n)
>  #define write(fd, buf, n) _write(fd, buf, n)
>  #define close(fd) _close(fd)

Note: Three-argument form of open() is seldom used in DPDK and only once
in OS-independent code. However, rte_os_shim.h can be included
in platform-specific file and it should not prevent using 3-argument open().
This patch is probably the most simple and robust thing we can do.

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

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

* Re: [dpdk-stable] [dpdk-dev] [PATCH] eal/windows: fix token pasting build warning
  2021-09-15 19:25 ` Dmitry Kozlyuk
@ 2021-09-23 17:17   ` Thomas Monjalon
  0 siblings, 0 replies; 3+ messages in thread
From: Thomas Monjalon @ 2021-09-23 17:17 UTC (permalink / raw)
  To: Tal Shnaiderman
  Cc: dev, pallavi.kadam, navasile, dmitrym, stable, Dmitry Kozlyuk

15/09/2021 21:25, Dmitry Kozlyuk:
> 2021-09-13 19:55 (UTC+0300), Tal Shnaiderman:
> > When building DPDK on Windows in debug mode the following
> > warning appear:
> > 
> > warning: token pasting of ',' and __VA_ARGS__ is a GNU extension
> > [-Wgnu-zero-variadic-macro-arguments] #define open(path, flags, ...)
> > _open(path, flags, ##__VA_ARGS__)
> > 
> > Modified the 'open' macro to avoid it.
> 
> Nit: "Modify" (present tense should be used here).
> 
> > 
> > Fixes: 45d62067c237 ("eal: make OS shims internal")
> > Cc: stable@dpdk.org
> > 
> > Signed-off-by: Tal Shnaiderman <talshn@nvidia.com>
> > ---
> > -#define open(path, flags, ...) _open(path, flags, ##__VA_ARGS__)
> > +#define open(...) _open(__VA_ARGS__)
> 
> Note: Three-argument form of open() is seldom used in DPDK and only once
> in OS-independent code. However, rte_os_shim.h can be included
> in platform-specific file and it should not prevent using 3-argument open().
> This patch is probably the most simple and robust thing we can do.
> 
> Acked-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>

Applied, thanks.




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

end of thread, other threads:[~2021-09-23 17:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-13 16:55 [dpdk-stable] [PATCH] eal/windows: fix token pasting build warning Tal Shnaiderman
2021-09-15 19:25 ` Dmitry Kozlyuk
2021-09-23 17:17   ` [dpdk-stable] [dpdk-dev] " Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).