* [dpdk-dev] [PATCH] eal/windows: fix build warnings in MinGW
@ 2021-04-18 17:08 Tal Shnaiderman
2021-04-18 18:13 ` Thomas Monjalon
2021-04-21 16:09 ` [dpdk-dev] [PATCH v2] " Tal Shnaiderman
0 siblings, 2 replies; 16+ messages in thread
From: Tal Shnaiderman @ 2021-04-18 17:08 UTC (permalink / raw)
To: dev; +Cc: thomas, pallavi.kadam, dmitry.kozliuk, navasile, dmitrym
the strncasecmp marco defined in rte_os_shim.h is already
defined in MinGW-w64, as a result the compiler prints out
the warning below on function redefinition whenever compiling
a file including the header.
..\lib/librte_eal/windows/include/rte_os_shim.h:21:
warning: "strncasecmp" redefined
#define strncasecmp(s1, s2, count) _strnicmp(s1, s2, count)
Fixed by defining the marco only to the clang compiler.
Fixes: 45d62067c237 ("eal: make OS shims internal")
Signed-off-by: Tal Shnaiderman <talshn@nvidia.com>
---
lib/librte_eal/windows/include/rte_os_shim.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/lib/librte_eal/windows/include/rte_os_shim.h b/lib/librte_eal/windows/include/rte_os_shim.h
index f40fb62d1d..db0ea6f1b3 100644
--- a/lib/librte_eal/windows/include/rte_os_shim.h
+++ b/lib/librte_eal/windows/include/rte_os_shim.h
@@ -17,7 +17,9 @@
#define strdup(str) _strdup(str)
#define strtok_r(str, delim, saveptr) strtok_s(str, delim, saveptr)
+#ifndef RTE_TOOLCHAIN_GCC
#define strncasecmp(s1, s2, count) _strnicmp(s1, s2, count)
+#endif
#define open(path, flags, ...) _open(path, flags, ##__VA_ARGS__)
#define read(fd, buf, n) _read(fd, buf, n)
--
2.16.1.windows.4
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [dpdk-dev] [PATCH] eal/windows: fix build warnings in MinGW
2021-04-18 17:08 [dpdk-dev] [PATCH] eal/windows: fix build warnings in MinGW Tal Shnaiderman
@ 2021-04-18 18:13 ` Thomas Monjalon
2021-04-18 19:04 ` Tal Shnaiderman
2021-04-21 16:09 ` [dpdk-dev] [PATCH v2] " Tal Shnaiderman
1 sibling, 1 reply; 16+ messages in thread
From: Thomas Monjalon @ 2021-04-18 18:13 UTC (permalink / raw)
To: Tal Shnaiderman; +Cc: dev, pallavi.kadam, dmitry.kozliuk, navasile, dmitrym
18/04/2021 19:08, Tal Shnaiderman:
> the strncasecmp marco defined in rte_os_shim.h is already
> defined in MinGW-w64, as a result the compiler prints out
> the warning below on function redefinition whenever compiling
> a file including the header.
>
> ..\lib/librte_eal/windows/include/rte_os_shim.h:21:
> warning: "strncasecmp" redefined
> #define strncasecmp(s1, s2, count) _strnicmp(s1, s2, count)
Why the tests are passing? Are we allowing warnings in build test?
> Fixed by defining the marco only to the clang compiler.
That's a very common typo: s/marco/macro/
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [dpdk-dev] [PATCH] eal/windows: fix build warnings in MinGW
2021-04-18 18:13 ` Thomas Monjalon
@ 2021-04-18 19:04 ` Tal Shnaiderman
2021-04-18 20:23 ` Dmitry Kozlyuk
0 siblings, 1 reply; 16+ messages in thread
From: Tal Shnaiderman @ 2021-04-18 19:04 UTC (permalink / raw)
To: NBU-Contact-Thomas Monjalon, dmitry.kozliuk
Cc: dev, pallavi.kadam, navasile, dmitrym
> Subject: Re: [PATCH] eal/windows: fix build warnings in MinGW
>
> External email: Use caution opening links or attachments
>
>
> 18/04/2021 19:08, Tal Shnaiderman:
> > the strncasecmp marco defined in rte_os_shim.h is already defined in
> > MinGW-w64, as a result the compiler prints out the warning below on
> > function redefinition whenever compiling a file including the header.
> >
> > ..\lib/librte_eal/windows/include/rte_os_shim.h:21:
> > warning: "strncasecmp" redefined
> > #define strncasecmp(s1, s2, count) _strnicmp(s1, s2, count)
>
> Why the tests are passing? Are we allowing warnings in build test?
It's a good question, I see CI is passing without warnings, Dmitry can you reproduce it?
On my side the collision is with the following file:
C:/mingw-w64/x86_64/mingw64/x86_64-w64-mingw32/include/string.h:119: note: this is the location of the previous definition
#define strncasecmp _strnicmp
I'm using:
-gcc (x86_64-win32-seh-rev0, Built by MinGW-W64 project) 8.1.0
-meson 0.53.2
>
> > Fixed by defining the marco only to the clang compiler.
>
> That's a very common typo: s/marco/macro/
>
Thanks, will fix in v2 if this patch is indeed needed.
>
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [dpdk-dev] [PATCH] eal/windows: fix build warnings in MinGW
2021-04-18 19:04 ` Tal Shnaiderman
@ 2021-04-18 20:23 ` Dmitry Kozlyuk
2021-04-19 6:57 ` Tal Shnaiderman
0 siblings, 1 reply; 16+ messages in thread
From: Dmitry Kozlyuk @ 2021-04-18 20:23 UTC (permalink / raw)
To: Tal Shnaiderman
Cc: NBU-Contact-Thomas Monjalon, dev, pallavi.kadam, navasile, dmitrym
Hi Tal,
2021-04-18 19:04 (UTC+0000), Tal Shnaiderman:
> > Subject: Re: [PATCH] eal/windows: fix build warnings in MinGW
> >
> > External email: Use caution opening links or attachments
> >
> >
> > 18/04/2021 19:08, Tal Shnaiderman:
> > > the strncasecmp marco defined in rte_os_shim.h is already defined in
> > > MinGW-w64, as a result the compiler prints out the warning below on
> > > function redefinition whenever compiling a file including the header.
> > >
> > > ..\lib/librte_eal/windows/include/rte_os_shim.h:21:
> > > warning: "strncasecmp" redefined
> > > #define strncasecmp(s1, s2, count) _strnicmp(s1, s2, count)
> >
> > Why the tests are passing? Are we allowing warnings in build test?
>
> It's a good question, I see CI is passing without warnings, Dmitry can you reproduce it?
>
> On my side the collision is with the following file:
>
> C:/mingw-w64/x86_64/mingw64/x86_64-w64-mingw32/include/string.h:119: note: this is the location of the previous definition
> #define strncasecmp _strnicmp
>
> I'm using:
> -gcc (x86_64-win32-seh-rev0, Built by MinGW-W64 project) 8.1.0
> -meson 0.53.2
I can't reproduce it using the same versions.
Do you invoke meson with other options than "-Dexamples=..."?
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [dpdk-dev] [PATCH] eal/windows: fix build warnings in MinGW
2021-04-18 20:23 ` Dmitry Kozlyuk
@ 2021-04-19 6:57 ` Tal Shnaiderman
2021-04-19 18:06 ` Tal Shnaiderman
2021-04-19 18:55 ` Dmitry Kozlyuk
0 siblings, 2 replies; 16+ messages in thread
From: Tal Shnaiderman @ 2021-04-19 6:57 UTC (permalink / raw)
To: Dmitry Kozlyuk
Cc: NBU-Contact-Thomas Monjalon, dev, pallavi.kadam, navasile, dmitrym
> Subject: Re: [PATCH] eal/windows: fix build warnings in MinGW
>
> External email: Use caution opening links or attachments
>
>
> Hi Tal,
>
> 2021-04-18 19:04 (UTC+0000), Tal Shnaiderman:
> > > Subject: Re: [PATCH] eal/windows: fix build warnings in MinGW
> > >
> > > External email: Use caution opening links or attachments
> > >
> > >
> > > 18/04/2021 19:08, Tal Shnaiderman:
> > > > the strncasecmp marco defined in rte_os_shim.h is already defined
> > > > in MinGW-w64, as a result the compiler prints out the warning
> > > > below on function redefinition whenever compiling a file including the
> header.
> > > >
> > > > ..\lib/librte_eal/windows/include/rte_os_shim.h:21:
> > > > warning: "strncasecmp" redefined
> > > > #define strncasecmp(s1, s2, count) _strnicmp(s1, s2, count)
> > >
> > > Why the tests are passing? Are we allowing warnings in build test?
> >
> > It's a good question, I see CI is passing without warnings, Dmitry can you
> reproduce it?
> >
> > On my side the collision is with the following file:
> >
> > C:/mingw-w64/x86_64/mingw64/x86_64-w64-
> mingw32/include/string.h:119:
> > note: this is the location of the previous definition #define
> > strncasecmp _strnicmp
> >
> > I'm using:
> > -gcc (x86_64-win32-seh-rev0, Built by MinGW-W64 project) 8.1.0 -meson
> > 0.53.2
>
> I can't reproduce it using the same versions.
> Do you invoke meson with other options than "-Dexamples=..."?
This is the meson line I'm using:
meson "-Dexamples=helloworld" build --wipe --default-library=static --buildtype debug
The problem however is that MinGW's string.h defines the macro in line 119, for some reason my build includes it and the rest doesn't.
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [dpdk-dev] [PATCH] eal/windows: fix build warnings in MinGW
2021-04-19 6:57 ` Tal Shnaiderman
@ 2021-04-19 18:06 ` Tal Shnaiderman
2021-04-19 18:15 ` Thomas Monjalon
2021-04-19 19:45 ` [dpdk-dev] " Dmitry Kozlyuk
2021-04-19 18:55 ` Dmitry Kozlyuk
1 sibling, 2 replies; 16+ messages in thread
From: Tal Shnaiderman @ 2021-04-19 18:06 UTC (permalink / raw)
To: Tal Shnaiderman, Dmitry Kozlyuk
Cc: NBU-Contact-Thomas Monjalon, dev, pallavi.kadam, navasile, dmitrym
> Subject: Re: [dpdk-dev] [PATCH] eal/windows: fix build warnings in MinGW
>
> External email: Use caution opening links or attachments
>
>
> > Subject: Re: [PATCH] eal/windows: fix build warnings in MinGW
> >
> > External email: Use caution opening links or attachments
> >
> >
> > Hi Tal,
> >
> > 2021-04-18 19:04 (UTC+0000), Tal Shnaiderman:
> > > > Subject: Re: [PATCH] eal/windows: fix build warnings in MinGW
> > > >
> > > > External email: Use caution opening links or attachments
> > > >
> > > >
> > > > 18/04/2021 19:08, Tal Shnaiderman:
> > > > > the strncasecmp marco defined in rte_os_shim.h is already
> > > > > defined in MinGW-w64, as a result the compiler prints out the
> > > > > warning below on function redefinition whenever compiling a file
> > > > > including the
> > header.
> > > > >
> > > > > ..\lib/librte_eal/windows/include/rte_os_shim.h:21:
> > > > > warning: "strncasecmp" redefined #define strncasecmp(s1, s2,
> > > > > count) _strnicmp(s1, s2, count)
> > > >
> > > > Why the tests are passing? Are we allowing warnings in build test?
> > >
> > > It's a good question, I see CI is passing without warnings, Dmitry
> > > can you
> > reproduce it?
> > >
> > > On my side the collision is with the following file:
> > >
> > > C:/mingw-w64/x86_64/mingw64/x86_64-w64-
> > mingw32/include/string.h:119:
> > > note: this is the location of the previous definition #define
> > > strncasecmp _strnicmp
> > >
> > > I'm using:
> > > -gcc (x86_64-win32-seh-rev0, Built by MinGW-W64 project) 8.1.0
> > > -meson
> > > 0.53.2
> >
> > I can't reproduce it using the same versions.
> > Do you invoke meson with other options than "-Dexamples=..."?
>
> This is the meson line I'm using:
>
> meson "-Dexamples=helloworld" build --wipe --default-library=static --
> buildtype debug
>
> The problem however is that MinGW's string.h defines the macro in line 119,
> for some reason my build includes it and the rest doesn't.
Hi Dmitry,
I also noticed warnings in clang on my setup that are related to rte_os_shim.h:
[185/314] Compiling C object drivers/a715181@@tmp_rte_common_mlx5@sta/common_mlx5_mlx5_common_mp.c.obj.
In file included from ../drivers/common/mlx5/mlx5_common_mp.c:13:
In file included from ..\drivers\common/mlx5/mlx5_common_utils.h:8:
In file included from ..\drivers\common/mlx5/mlx5_common.h:17:
..\lib/librte_eal/windows/include\rte_os_shim.h:22:51: 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__)
^
However don't see it in CI, I'm using clang version 9.0.1
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [dpdk-dev] [PATCH] eal/windows: fix build warnings in MinGW
2021-04-19 18:06 ` Tal Shnaiderman
@ 2021-04-19 18:15 ` Thomas Monjalon
2021-04-19 19:29 ` [dpdk-dev] [dpdk-ci] " Aaron Conole
2021-04-19 19:45 ` [dpdk-dev] " Dmitry Kozlyuk
1 sibling, 1 reply; 16+ messages in thread
From: Thomas Monjalon @ 2021-04-19 18:15 UTC (permalink / raw)
To: Tal Shnaiderman; +Cc: Dmitry Kozlyuk, dev, pallavi.kadam, navasile, dmitrym, ci
19/04/2021 20:06, Tal Shnaiderman:
> > > 2021-04-18 19:04 (UTC+0000), Tal Shnaiderman:
> > > > > 18/04/2021 19:08, Tal Shnaiderman:
> > > > > > the strncasecmp marco defined in rte_os_shim.h is already
> > > > > > defined in MinGW-w64, as a result the compiler prints out the
> > > > > > warning below on function redefinition whenever compiling a file
> > > > > > including the
> > > header.
> > > > > >
> > > > > > ..\lib/librte_eal/windows/include/rte_os_shim.h:21:
> > > > > > warning: "strncasecmp" redefined #define strncasecmp(s1, s2,
> > > > > > count) _strnicmp(s1, s2, count)
> > > > >
> > > > > Why the tests are passing? Are we allowing warnings in build test?
> > > >
> > > > It's a good question, I see CI is passing without warnings, Dmitry
> > > > can you
> > > reproduce it?
> > > >
> > > > On my side the collision is with the following file:
> > > >
> > > > C:/mingw-w64/x86_64/mingw64/x86_64-w64-
> > > mingw32/include/string.h:119:
> > > > note: this is the location of the previous definition #define
> > > > strncasecmp _strnicmp
> > > >
> > > > I'm using:
> > > > -gcc (x86_64-win32-seh-rev0, Built by MinGW-W64 project) 8.1.0
> > > > -meson
> > > > 0.53.2
> > >
> > > I can't reproduce it using the same versions.
> > > Do you invoke meson with other options than "-Dexamples=..."?
> >
> > This is the meson line I'm using:
> >
> > meson "-Dexamples=helloworld" build --wipe --default-library=static --
> > buildtype debug
> >
> > The problem however is that MinGW's string.h defines the macro in line 119,
> > for some reason my build includes it and the rest doesn't.
>
> Hi Dmitry,
>
> I also noticed warnings in clang on my setup that are related to rte_os_shim.h:
>
> [185/314] Compiling C object drivers/a715181@@tmp_rte_common_mlx5@sta/common_mlx5_mlx5_common_mp.c.obj.
> In file included from ../drivers/common/mlx5/mlx5_common_mp.c:13:
> In file included from ..\drivers\common/mlx5/mlx5_common_utils.h:8:
> In file included from ..\drivers\common/mlx5/mlx5_common.h:17:
> ..\lib/librte_eal/windows/include\rte_os_shim.h:22:51: 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__)
> ^
> However don't see it in CI, I'm using clang version 9.0.1
It seems we should improve our CI.
Please open suggestions in the CI bugzilla.
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [dpdk-dev] [PATCH] eal/windows: fix build warnings in MinGW
2021-04-19 6:57 ` Tal Shnaiderman
2021-04-19 18:06 ` Tal Shnaiderman
@ 2021-04-19 18:55 ` Dmitry Kozlyuk
1 sibling, 0 replies; 16+ messages in thread
From: Dmitry Kozlyuk @ 2021-04-19 18:55 UTC (permalink / raw)
To: Tal Shnaiderman
Cc: NBU-Contact-Thomas Monjalon, dev, pallavi.kadam, navasile, dmitrym
2021-04-19 06:57 (UTC+0000), Tal Shnaiderman:
> [...]
> > > > 18/04/2021 19:08, Tal Shnaiderman:
> > > > > the strncasecmp marco defined in rte_os_shim.h is already defined
> > > > > in MinGW-w64, as a result the compiler prints out the warning
> > > > > below on function redefinition whenever compiling a file including the
> > header.
> > > > >
> > > > > ..\lib/librte_eal/windows/include/rte_os_shim.h:21:
> > > > > warning: "strncasecmp" redefined
> > > > > #define strncasecmp(s1, s2, count) _strnicmp(s1, s2, count)
> > > >
> > > > Why the tests are passing? Are we allowing warnings in build test?
> > >
> > > It's a good question, I see CI is passing without warnings, Dmitry can you
> > reproduce it?
> > >
> > > On my side the collision is with the following file:
> > >
> > > C:/mingw-w64/x86_64/mingw64/x86_64-w64-
> > mingw32/include/string.h:119:
> > > note: this is the location of the previous definition #define
> > > strncasecmp _strnicmp
> > >
> > > I'm using:
> > > -gcc (x86_64-win32-seh-rev0, Built by MinGW-W64 project) 8.1.0 -meson
> > > 0.53.2
> >
> > I can't reproduce it using the same versions.
> > Do you invoke meson with other options than "-Dexamples=..."?
>
> This is the meson line I'm using:
>
> meson "-Dexamples=helloworld" build --wipe --default-library=static --buildtype debug
>
> The problem however is that MinGW's string.h defines the macro in line 119, for some reason my build includes it and the rest doesn't.
--default-library=static it the key, it changes MinGW from using inline
functions to using macros for strncasecmp().
MinGW portion devtools/check-meson-builds.sh should test this variant.
I searched for other defines from rte_os_shim.h in MinGW includes and it
seems strncasecmp() is the only problematic one. Thanks, I'm ready to ack v2
as soon as you send it.
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [dpdk-dev] [dpdk-ci] [PATCH] eal/windows: fix build warnings in MinGW
2021-04-19 18:15 ` Thomas Monjalon
@ 2021-04-19 19:29 ` Aaron Conole
2021-04-19 20:09 ` Dmitry Kozlyuk
0 siblings, 1 reply; 16+ messages in thread
From: Aaron Conole @ 2021-04-19 19:29 UTC (permalink / raw)
To: Thomas Monjalon
Cc: Tal Shnaiderman, Dmitry Kozlyuk, dev, pallavi.kadam, navasile,
dmitrym, ci
Thomas Monjalon <thomas@monjalon.net> writes:
> 19/04/2021 20:06, Tal Shnaiderman:
>> > > 2021-04-18 19:04 (UTC+0000), Tal Shnaiderman:
>> > > > > 18/04/2021 19:08, Tal Shnaiderman:
>> > > > > > the strncasecmp marco defined in rte_os_shim.h is already
>> > > > > > defined in MinGW-w64, as a result the compiler prints out the
>> > > > > > warning below on function redefinition whenever compiling a file
>> > > > > > including the
>> > > header.
>> > > > > >
>> > > > > > ..\lib/librte_eal/windows/include/rte_os_shim.h:21:
>> > > > > > warning: "strncasecmp" redefined #define strncasecmp(s1, s2,
>> > > > > > count) _strnicmp(s1, s2, count)
>> > > > >
>> > > > > Why the tests are passing? Are we allowing warnings in build test?
>> > > >
>> > > > It's a good question, I see CI is passing without warnings, Dmitry
>> > > > can you
>> > > reproduce it?
>> > > >
>> > > > On my side the collision is with the following file:
>> > > >
>> > > > C:/mingw-w64/x86_64/mingw64/x86_64-w64-
>> > > mingw32/include/string.h:119:
>> > > > note: this is the location of the previous definition #define
>> > > > strncasecmp _strnicmp
>> > > >
>> > > > I'm using:
>> > > > -gcc (x86_64-win32-seh-rev0, Built by MinGW-W64 project) 8.1.0
>> > > > -meson
>> > > > 0.53.2
>> > >
>> > > I can't reproduce it using the same versions.
>> > > Do you invoke meson with other options than "-Dexamples=..."?
>> >
>> > This is the meson line I'm using:
>> >
>> > meson "-Dexamples=helloworld" build --wipe --default-library=static --
>> > buildtype debug
>> >
>> > The problem however is that MinGW's string.h defines the macro in line 119,
>> > for some reason my build includes it and the rest doesn't.
>>
>> Hi Dmitry,
>>
>> I also noticed warnings in clang on my setup that are related to rte_os_shim.h:
>>
>> [185/314] Compiling C object drivers/a715181@@tmp_rte_common_mlx5@sta/common_mlx5_mlx5_common_mp.c.obj.
>> In file included from ../drivers/common/mlx5/mlx5_common_mp.c:13:
>> In file included from ..\drivers\common/mlx5/mlx5_common_utils.h:8:
>> In file included from ..\drivers\common/mlx5/mlx5_common.h:17:
>> ..\lib/librte_eal/windows/include\rte_os_shim.h:22:51: 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__)
>> ^
>> However don't see it in CI, I'm using clang version 9.0.1
>
> It seems we should improve our CI.
> Please open suggestions in the CI bugzilla.
Please do.
Will this only be caught by mingw64 on windows? Will we get the same
issues with a linux mingw install? I'm guessing yes, but don't know
mingw very well. We may be able to install the mingw package under our
github actions pipeline.
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [dpdk-dev] [PATCH] eal/windows: fix build warnings in MinGW
2021-04-19 18:06 ` Tal Shnaiderman
2021-04-19 18:15 ` Thomas Monjalon
@ 2021-04-19 19:45 ` Dmitry Kozlyuk
1 sibling, 0 replies; 16+ messages in thread
From: Dmitry Kozlyuk @ 2021-04-19 19:45 UTC (permalink / raw)
To: Tal Shnaiderman
Cc: NBU-Contact-Thomas Monjalon, dev, pallavi.kadam, navasile, dmitrym
Hi Tal,
2021-04-19 18:06 (UTC+0000), Tal Shnaiderman:
> I also noticed warnings in clang on my setup that are related to rte_os_shim.h:
>
> [185/314] Compiling C object drivers/a715181@@tmp_rte_common_mlx5@sta/common_mlx5_mlx5_common_mp.c.obj.
> In file included from ../drivers/common/mlx5/mlx5_common_mp.c:13:
> In file included from ..\drivers\common/mlx5/mlx5_common_utils.h:8:
> In file included from ..\drivers\common/mlx5/mlx5_common.h:17:
> ..\lib/librte_eal/windows/include\rte_os_shim.h:22:51: 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__)
> ^
> However don't see it in CI, I'm using clang version 9.0.1
This warning only appears with --buildtype=debug, that's why I missed it.
I don't see a good way to fix it except #define open _open,
RTE_FMT_xxx approach is not applicable here.
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [dpdk-dev] [dpdk-ci] [PATCH] eal/windows: fix build warnings in MinGW
2021-04-19 19:29 ` [dpdk-dev] [dpdk-ci] " Aaron Conole
@ 2021-04-19 20:09 ` Dmitry Kozlyuk
2021-04-19 20:33 ` Lincoln Lavoie
2021-04-20 11:01 ` Tal Shnaiderman
0 siblings, 2 replies; 16+ messages in thread
From: Dmitry Kozlyuk @ 2021-04-19 20:09 UTC (permalink / raw)
To: Aaron Conole
Cc: Thomas Monjalon, Tal Shnaiderman, dev, pallavi.kadam, navasile,
dmitrym, ci
2021-04-19 15:29 (UTC-0400), Aaron Conole:
> Thomas Monjalon <thomas@monjalon.net> writes:
>
> > 19/04/2021 20:06, Tal Shnaiderman:
> >> > > 2021-04-18 19:04 (UTC+0000), Tal Shnaiderman:
> >> > > > > 18/04/2021 19:08, Tal Shnaiderman:
> >> > > > > > the strncasecmp marco defined in rte_os_shim.h is already
> >> > > > > > defined in MinGW-w64, as a result the compiler prints out the
> >> > > > > > warning below on function redefinition whenever compiling a file
> >> > > > > > including the
> >> > > header.
> >> > > > > >
> >> > > > > > ..\lib/librte_eal/windows/include/rte_os_shim.h:21:
> >> > > > > > warning: "strncasecmp" redefined #define strncasecmp(s1, s2,
> >> > > > > > count) _strnicmp(s1, s2, count)
> >> > > > >
> >> > > > > Why the tests are passing? Are we allowing warnings in build test?
> >> > > >
> >> > > > It's a good question, I see CI is passing without warnings, Dmitry
> >> > > > can you
> >> > > reproduce it?
> >> > > >
> >> > > > On my side the collision is with the following file:
> >> > > >
> >> > > > C:/mingw-w64/x86_64/mingw64/x86_64-w64-
> >> > > mingw32/include/string.h:119:
> >> > > > note: this is the location of the previous definition #define
> >> > > > strncasecmp _strnicmp
> >> > > >
> >> > > > I'm using:
> >> > > > -gcc (x86_64-win32-seh-rev0, Built by MinGW-W64 project) 8.1.0
> >> > > > -meson
> >> > > > 0.53.2
> >> > >
> >> > > I can't reproduce it using the same versions.
> >> > > Do you invoke meson with other options than "-Dexamples=..."?
> >> >
> >> > This is the meson line I'm using:
> >> >
> >> > meson "-Dexamples=helloworld" build --wipe --default-library=static --
> >> > buildtype debug
> >> >
> >> > The problem however is that MinGW's string.h defines the macro in line 119,
> >> > for some reason my build includes it and the rest doesn't.
> >>
> >> Hi Dmitry,
> >>
> >> I also noticed warnings in clang on my setup that are related to rte_os_shim.h:
> >>
> >> [185/314] Compiling C object drivers/a715181@@tmp_rte_common_mlx5@sta/common_mlx5_mlx5_common_mp.c.obj.
> >> In file included from ../drivers/common/mlx5/mlx5_common_mp.c:13:
> >> In file included from ..\drivers\common/mlx5/mlx5_common_utils.h:8:
> >> In file included from ..\drivers\common/mlx5/mlx5_common.h:17:
> >> ..\lib/librte_eal/windows/include\rte_os_shim.h:22:51: 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__)
> >> ^
> >> However don't see it in CI, I'm using clang version 9.0.1
> >
> > It seems we should improve our CI.
> > Please open suggestions in the CI bugzilla.
>
> Please do.
>
> Will this only be caught by mingw64 on windows? Will we get the same
> issues with a linux mingw install? I'm guessing yes, but don't know
> mingw very well. We may be able to install the mingw package under our
> github actions pipeline.
Yes, Linux MinGW-w64 produces the same warning (about strncasecmp).
__VA_ARGS__ warning won't show up with GNU compiler, obviously.
It may with ICC, but I don't have it to check.
I figured out it's not --default-library=static, but --buildtype=debug that
caues the arning to appear, my mistake in previous message.
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [dpdk-dev] [dpdk-ci] [PATCH] eal/windows: fix build warnings in MinGW
2021-04-19 20:09 ` Dmitry Kozlyuk
@ 2021-04-19 20:33 ` Lincoln Lavoie
2021-04-20 11:01 ` Tal Shnaiderman
1 sibling, 0 replies; 16+ messages in thread
From: Lincoln Lavoie @ 2021-04-19 20:33 UTC (permalink / raw)
To: Dmitry Kozlyuk
Cc: Aaron Conole, Thomas Monjalon, Tal Shnaiderman, dev,
pallavi.kadam, navasile, dmitrym, ci
Is that related to a recent patch (I think it was David's, but don't quote
me on that) that enabled a debug build mode when it sees git repo info
within the build root?
Cheers,
Lincoln
On Mon, Apr 19, 2021 at 4:09 PM Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
wrote:
> 2021-04-19 15:29 (UTC-0400), Aaron Conole:
> > Thomas Monjalon <thomas@monjalon.net> writes:
> >
> > > 19/04/2021 20:06, Tal Shnaiderman:
> > >> > > 2021-04-18 19:04 (UTC+0000), Tal Shnaiderman:
> > >> > > > > 18/04/2021 19:08, Tal Shnaiderman:
> > >> > > > > > the strncasecmp marco defined in rte_os_shim.h is already
> > >> > > > > > defined in MinGW-w64, as a result the compiler prints out
> the
> > >> > > > > > warning below on function redefinition whenever compiling a
> file
> > >> > > > > > including the
> > >> > > header.
> > >> > > > > >
> > >> > > > > > ..\lib/librte_eal/windows/include/rte_os_shim.h:21:
> > >> > > > > > warning: "strncasecmp" redefined #define strncasecmp(s1, s2,
> > >> > > > > > count) _strnicmp(s1, s2, count)
> > >> > > > >
> > >> > > > > Why the tests are passing? Are we allowing warnings in build
> test?
> > >> > > >
> > >> > > > It's a good question, I see CI is passing without warnings,
> Dmitry
> > >> > > > can you
> > >> > > reproduce it?
> > >> > > >
> > >> > > > On my side the collision is with the following file:
> > >> > > >
> > >> > > > C:/mingw-w64/x86_64/mingw64/x86_64-w64-
> > >> > > mingw32/include/string.h:119:
> > >> > > > note: this is the location of the previous definition #define
> > >> > > > strncasecmp _strnicmp
> > >> > > >
> > >> > > > I'm using:
> > >> > > > -gcc (x86_64-win32-seh-rev0, Built by MinGW-W64 project) 8.1.0
> > >> > > > -meson
> > >> > > > 0.53.2
> > >> > >
> > >> > > I can't reproduce it using the same versions.
> > >> > > Do you invoke meson with other options than "-Dexamples=..."?
> > >> >
> > >> > This is the meson line I'm using:
> > >> >
> > >> > meson "-Dexamples=helloworld" build --wipe --default-library=static
> --
> > >> > buildtype debug
> > >> >
> > >> > The problem however is that MinGW's string.h defines the macro in
> line 119,
> > >> > for some reason my build includes it and the rest doesn't.
> > >>
> > >> Hi Dmitry,
> > >>
> > >> I also noticed warnings in clang on my setup that are related to
> rte_os_shim.h:
> > >>
> > >> [185/314] Compiling C object drivers/a715181@@tmp_rte_common_mlx5@sta
> /common_mlx5_mlx5_common_mp.c.obj.
> > >> In file included from ../drivers/common/mlx5/mlx5_common_mp.c:13:
> > >> In file included from ..\drivers\common/mlx5/mlx5_common_utils.h:8:
> > >> In file included from ..\drivers\common/mlx5/mlx5_common.h:17:
> > >> ..\lib/librte_eal/windows/include\rte_os_shim.h:22:51: 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__)
> > >> ^
> > >> However don't see it in CI, I'm using clang version 9.0.1
> > >
> > > It seems we should improve our CI.
> > > Please open suggestions in the CI bugzilla.
> >
> > Please do.
> >
> > Will this only be caught by mingw64 on windows? Will we get the same
> > issues with a linux mingw install? I'm guessing yes, but don't know
> > mingw very well. We may be able to install the mingw package under our
> > github actions pipeline.
>
> Yes, Linux MinGW-w64 produces the same warning (about strncasecmp).
> __VA_ARGS__ warning won't show up with GNU compiler, obviously.
> It may with ICC, but I don't have it to check.
>
> I figured out it's not --default-library=static, but --buildtype=debug that
> caues the arning to appear, my mistake in previous message.
>
--
*Lincoln Lavoie*
Principal Engineer, Broadband Technologies
21 Madbury Rd., Ste. 100, Durham, NH 03824
lylavoie@iol.unh.edu
https://www.iol.unh.edu
+1-603-674-2755 (m)
<https://www.iol.unh.edu>
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [dpdk-dev] [dpdk-ci] [PATCH] eal/windows: fix build warnings in MinGW
2021-04-19 20:09 ` Dmitry Kozlyuk
2021-04-19 20:33 ` Lincoln Lavoie
@ 2021-04-20 11:01 ` Tal Shnaiderman
1 sibling, 0 replies; 16+ messages in thread
From: Tal Shnaiderman @ 2021-04-20 11:01 UTC (permalink / raw)
To: Dmitry Kozlyuk, Aaron Conole
Cc: NBU-Contact-Thomas Monjalon, dev, pallavi.kadam, navasile, dmitrym, ci
> Subject: Re: [dpdk-ci] [PATCH] eal/windows: fix build warnings in MinGW
>
> External email: Use caution opening links or attachments
>
>
> 2021-04-19 15:29 (UTC-0400), Aaron Conole:
> > Thomas Monjalon <thomas@monjalon.net> writes:
> >
> > > 19/04/2021 20:06, Tal Shnaiderman:
> > >> > > 2021-04-18 19:04 (UTC+0000), Tal Shnaiderman:
> > >> > > > > 18/04/2021 19:08, Tal Shnaiderman:
> > >> > > > > > the strncasecmp marco defined in rte_os_shim.h is already
> > >> > > > > > defined in MinGW-w64, as a result the compiler prints out
> > >> > > > > > the warning below on function redefinition whenever
> > >> > > > > > compiling a file including the
> > >> > > header.
> > >> > > > > >
> > >> > > > > > ..\lib/librte_eal/windows/include/rte_os_shim.h:21:
> > >> > > > > > warning: "strncasecmp" redefined #define strncasecmp(s1,
> > >> > > > > > s2,
> > >> > > > > > count) _strnicmp(s1, s2, count)
> > >> > > > >
> > >> > > > > Why the tests are passing? Are we allowing warnings in build
> test?
> > >> > > >
> > >> > > > It's a good question, I see CI is passing without warnings,
> > >> > > > Dmitry can you
> > >> > > reproduce it?
> > >> > > >
> > >> > > > On my side the collision is with the following file:
> > >> > > >
> > >> > > > C:/mingw-w64/x86_64/mingw64/x86_64-w64-
> > >> > > mingw32/include/string.h:119:
> > >> > > > note: this is the location of the previous definition
> > >> > > > #define strncasecmp _strnicmp
> > >> > > >
> > >> > > > I'm using:
> > >> > > > -gcc (x86_64-win32-seh-rev0, Built by MinGW-W64 project)
> > >> > > > 8.1.0 -meson
> > >> > > > 0.53.2
> > >> > >
> > >> > > I can't reproduce it using the same versions.
> > >> > > Do you invoke meson with other options than "-Dexamples=..."?
> > >> >
> > >> > This is the meson line I'm using:
> > >> >
> > >> > meson "-Dexamples=helloworld" build --wipe
> > >> > --default-library=static -- buildtype debug
> > >> >
> > >> > The problem however is that MinGW's string.h defines the macro in
> > >> > line 119, for some reason my build includes it and the rest doesn't.
> > >>
> > >> Hi Dmitry,
> > >>
> > >> I also noticed warnings in clang on my setup that are related to
> rte_os_shim.h:
> > >>
> > >> [185/314] Compiling C object
> drivers/a715181@@tmp_rte_common_mlx5@sta/common_mlx5_mlx5_co
> mmon_mp.c.obj.
> > >> In file included from ../drivers/common/mlx5/mlx5_common_mp.c:13:
> > >> In file included from ..\drivers\common/mlx5/mlx5_common_utils.h:8:
> > >> In file included from ..\drivers\common/mlx5/mlx5_common.h:17:
> > >> ..\lib/librte_eal/windows/include\rte_os_shim.h:22:51: 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__)
> > >> ^ However don't
> > >> see it in CI, I'm using clang version 9.0.1
> > >
> > > It seems we should improve our CI.
> > > Please open suggestions in the CI bugzilla.
> >
> > Please do.
> >
> > Will this only be caught by mingw64 on windows? Will we get the same
> > issues with a linux mingw install? I'm guessing yes, but don't know
> > mingw very well. We may be able to install the mingw package under
> > our github actions pipeline.
>
> Yes, Linux MinGW-w64 produces the same warning (about strncasecmp).
> __VA_ARGS__ warning won't show up with GNU compiler, obviously.
> It may with ICC, but I don't have it to check.
>
> I figured out it's not --default-library=static, but --buildtype=debug that
> caues the arning to appear, my mistake in previous message.
Right, using --buildtype=release doesn't reproduce the error.
BTW, how does release build passes if I excluded the definition from RTE_TOOLCHAIN_GCC?
^ permalink raw reply [flat|nested] 16+ messages in thread
* [dpdk-dev] [PATCH v2] eal/windows: fix build warnings in MinGW
2021-04-18 17:08 [dpdk-dev] [PATCH] eal/windows: fix build warnings in MinGW Tal Shnaiderman
2021-04-18 18:13 ` Thomas Monjalon
@ 2021-04-21 16:09 ` Tal Shnaiderman
2021-04-26 15:58 ` Dmitry Kozlyuk
1 sibling, 1 reply; 16+ messages in thread
From: Tal Shnaiderman @ 2021-04-21 16:09 UTC (permalink / raw)
To: dev; +Cc: thomas, pallavi.kadam, dmitry.kozliuk, navasile, dmitrym
the strncasecmp macro defined in rte_os_shim.h is already
defined in MinGW-w64, as a result the compiler prints out
the warning below on function redefinition whenever compiling
a file including the header in debug mode.
..\lib/librte_eal/windows/include/rte_os_shim.h:21:
warning: "strncasecmp" redefined
#define strncasecmp(s1, s2, count) _strnicmp(s1, s2, count)
Fixed by defining the macro only to the clang compiler.
Fixes: 45d62067c237 ("eal: make OS shims internal")
Signed-off-by: Tal Shnaiderman <talshn@nvidia.com>
---
v2: fix commit message typo [Thomas]
---
lib/librte_eal/windows/include/rte_os_shim.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/lib/librte_eal/windows/include/rte_os_shim.h b/lib/librte_eal/windows/include/rte_os_shim.h
index f40fb62d1d..db0ea6f1b3 100644
--- a/lib/librte_eal/windows/include/rte_os_shim.h
+++ b/lib/librte_eal/windows/include/rte_os_shim.h
@@ -17,7 +17,9 @@
#define strdup(str) _strdup(str)
#define strtok_r(str, delim, saveptr) strtok_s(str, delim, saveptr)
+#ifndef RTE_TOOLCHAIN_GCC
#define strncasecmp(s1, s2, count) _strnicmp(s1, s2, count)
+#endif
#define open(path, flags, ...) _open(path, flags, ##__VA_ARGS__)
#define read(fd, buf, n) _read(fd, buf, n)
--
2.16.1.windows.4
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [dpdk-dev] [PATCH v2] eal/windows: fix build warnings in MinGW
2021-04-21 16:09 ` [dpdk-dev] [PATCH v2] " Tal Shnaiderman
@ 2021-04-26 15:58 ` Dmitry Kozlyuk
2021-05-04 17:17 ` Thomas Monjalon
0 siblings, 1 reply; 16+ messages in thread
From: Dmitry Kozlyuk @ 2021-04-26 15:58 UTC (permalink / raw)
To: Tal Shnaiderman; +Cc: dev, thomas, pallavi.kadam, navasile, dmitrym
2021-04-21 19:09 (UTC+0300), Tal Shnaiderman:
> the strncasecmp macro defined in rte_os_shim.h is already
> defined in MinGW-w64, as a result the compiler prints out
> the warning below on function redefinition whenever compiling
> a file including the header in debug mode.
>
> ..\lib/librte_eal/windows/include/rte_os_shim.h:21:
> warning: "strncasecmp" redefined
> #define strncasecmp(s1, s2, count) _strnicmp(s1, s2, count)
>
> Fixed by defining the macro only to the clang compiler.
>
> Fixes: 45d62067c237 ("eal: make OS shims internal")
>
> Signed-off-by: Tal Shnaiderman <talshn@nvidia.com>
With librte_eal -> eal fixup,
Acked-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [dpdk-dev] [PATCH v2] eal/windows: fix build warnings in MinGW
2021-04-26 15:58 ` Dmitry Kozlyuk
@ 2021-05-04 17:17 ` Thomas Monjalon
0 siblings, 0 replies; 16+ messages in thread
From: Thomas Monjalon @ 2021-05-04 17:17 UTC (permalink / raw)
To: Tal Shnaiderman; +Cc: dev, pallavi.kadam, navasile, dmitrym, Dmitry Kozlyuk
26/04/2021 17:58, Dmitry Kozlyuk:
> 2021-04-21 19:09 (UTC+0300), Tal Shnaiderman:
> > the strncasecmp macro defined in rte_os_shim.h is already
> > defined in MinGW-w64, as a result the compiler prints out
> > the warning below on function redefinition whenever compiling
> > a file including the header in debug mode.
> >
> > ..\lib/librte_eal/windows/include/rte_os_shim.h:21:
> > warning: "strncasecmp" redefined
> > #define strncasecmp(s1, s2, count) _strnicmp(s1, s2, count)
> >
> > Fixed by defining the macro only to the clang compiler.
> >
> > Fixes: 45d62067c237 ("eal: make OS shims internal")
> >
> > Signed-off-by: Tal Shnaiderman <talshn@nvidia.com>
>
> With librte_eal -> eal fixup,
> Acked-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
Applied, thanks.
^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2021-05-04 17:17 UTC | newest]
Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-18 17:08 [dpdk-dev] [PATCH] eal/windows: fix build warnings in MinGW Tal Shnaiderman
2021-04-18 18:13 ` Thomas Monjalon
2021-04-18 19:04 ` Tal Shnaiderman
2021-04-18 20:23 ` Dmitry Kozlyuk
2021-04-19 6:57 ` Tal Shnaiderman
2021-04-19 18:06 ` Tal Shnaiderman
2021-04-19 18:15 ` Thomas Monjalon
2021-04-19 19:29 ` [dpdk-dev] [dpdk-ci] " Aaron Conole
2021-04-19 20:09 ` Dmitry Kozlyuk
2021-04-19 20:33 ` Lincoln Lavoie
2021-04-20 11:01 ` Tal Shnaiderman
2021-04-19 19:45 ` [dpdk-dev] " Dmitry Kozlyuk
2021-04-19 18:55 ` Dmitry Kozlyuk
2021-04-21 16:09 ` [dpdk-dev] [PATCH v2] " Tal Shnaiderman
2021-04-26 15:58 ` Dmitry Kozlyuk
2021-05-04 17:17 ` 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).