eal/windows: fix build warnings in MinGW
PATCH 1/1 eal/windows: fix build warnings in MinGW
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.
--- lib/librte_eal/windows/include/rte_os_shim.h | 2 ++ 1 file changed, 2 insertions(+)
lib/librte_eal/windows/include/rte_os_shim.h +2 -0
@@ -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)
Signature · 1 line
2.16.1.windows.4
18/04/2021 19:08, Tal Shnaiderman:
Quoted 8 lines
the strncasecmp marco defined in
rte_os_shim.his 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
#definestrncasecmp(s1, s2, count)_strnicmp(s1, s2, count)
Why the tests are passing? Are we allowing warnings in build test?
Quoted 1 line
Fixed by defining the marco only to the clang compiler.
That's a very common typo: s/marco/macro/
Quoted 10 lines
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:
Quoted 4 lines
the strncasecmp marco defined in
rte_os_shim.his 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.
Quoted 5 lines
Quoted 3 lines
..\lib/librte_eal/windows/include/rte_os_shim.h:21:
warning: "strncasecmp" redefined
#definestrncasecmp(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
Quoted 5 lines
Quoted 2 lines
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.
Quoted 1 line
Hi Tal,
2021-04-18 19:04 (UTC+0000), Tal Shnaiderman:
Quoted 24 lines
Quoted 10 lines
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:
Quoted 4 lines
the strncasecmp marco defined in
rte_os_shim.his 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.Quoted 5 lines
Quoted 3 lines
..\lib/librte_eal/windows/include/rte_os_shim.h:21:
warning: "strncasecmp" redefined
#definestrncasecmp(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_strnicmpI'm using:
Review
Quoted 2 lines
(quoted diff) +0
-2-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=..."?
Quoted 35 lines
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:
Quoted 9 lines
Quoted 9 lines
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:
Quoted 3 lines
the strncasecmp marco defined in
rte_os_shim.his already defined in MinGW-w64, as a result the compiler prints out the warning below on function redefinition whenever compiling a file including theheader.
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
..\lib/librte_eal/windows/include/rte_os_shim.h:21:
warning: "strncasecmp" redefined
#definestrncasecmp(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?
Quoted 4 lines
On my side the collision is with the following file:
C:/mingw-w64/x86_64/mingw64/x86_64-w64-
mingw32/include/string.h:119:Quoted 3 lines
note: this is the location of the previous definition #define strncasecmp
_strnicmp
Quoted 6 lines
Quoted 3 lines
I'm using:
-gcc (x86_64-win32-seh-rev0, Built by MinGW-W64 project) 8.1.0 -meson 0.53.2I 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.
Quoted 50 lines
Subject: Re: [dpdk-dev] [PATCH] eal/windows: fix build warnings in MinGW
External email: Use caution opening links or attachments
Quoted 37 lines
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:
Quoted 10 lines
Quoted 10 lines
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:
Quoted 4 lines
the strncasecmp marco defined in
rte_os_shim.his already defined in MinGW-w64, as a result the compiler prints out the warning below on function redefinition whenever compiling a file including theheader.
Quoted 9 lines
Quoted 6 lines
Quoted 4 lines
..\lib/librte_eal/windows/include/rte_os_shim.h:21:
warning: "strncasecmp" redefined #definestrncasecmp(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?
Quoted 4 lines
On my side the collision is with the following file:
C:/mingw-w64/x86_64/mingw64/x86_64-w64-
mingw32/include/string.h:119:Quoted 3 lines
note: this is the location of the previous definition #define strncasecmp
_strnicmpQuoted 7 lines
Quoted 4 lines
I'm using:
(quoted diff) +0
-2-gcc (x86_64-win32-seh-rev0, Built by MinGW-W64 project) 8.1.0 -meson0.53.2
I can't reproduce it using the same versions.
Do you invoke meson with other options than "-Dexamples=..."?
Quoted 7 lines
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.hdefines 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
19/04/2021 20:06, Tal Shnaiderman:
Quoted 45 lines
Quoted 33 lines
Quoted 25 lines
2021-04-18 19:04 (UTC+0000), Tal Shnaiderman:
Quoted 5 lines
Quoted 5 lines
18/04/2021 19:08, Tal Shnaiderman:
Quoted 4 lines
the strncasecmp marco defined in
rte_os_shim.his already defined in MinGW-w64, as a result the compiler prints out the warning below on function redefinition whenever compiling a file including theheader.
Quoted 9 lines
Quoted 6 lines
Quoted 4 lines
..\lib/librte_eal/windows/include/rte_os_shim.h:21:
warning: "strncasecmp" redefined #definestrncasecmp(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?
Quoted 4 lines
On my side the collision is with the following file:
C:/mingw-w64/x86_64/mingw64/x86_64-w64-
mingw32/include/string.h:119:Quoted 3 lines
note: this is the location of the previous definition #define strncasecmp
_strnicmpQuoted 7 lines
Quoted 4 lines
I'm using:
(quoted diff) +0
-2-gcc (x86_64-win32-seh-rev0, Built by MinGW-W64 project) 8.1.0 -meson0.53.2
I can't reproduce it using the same versions.
Do you invoke meson with other options than "-Dexamples=..."?Quoted 7 lines
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.hdefines 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:
Quoted 8 lines
[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.
Quoted 57 lines · Thomas Monjalon
19/04/2021 20:06, Tal Shnaiderman:
Quoted 52 lines
Quoted 33 lines
Quoted 25 lines
2021-04-18 19:04 (UTC+0000), Tal Shnaiderman:
Quoted 5 lines
Quoted 5 lines
18/04/2021 19:08, Tal Shnaiderman:
Quoted 4 lines
the strncasecmp marco defined in
rte_os_shim.his already defined in MinGW-w64, as a result the compiler prints out the warning below on function redefinition whenever compiling a file including theheader.
Quoted 9 lines
Quoted 6 lines
Quoted 4 lines
..\lib/librte_eal/windows/include/rte_os_shim.h:21:
warning: "strncasecmp" redefined #definestrncasecmp(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?
Quoted 4 lines
On my side the collision is with the following file:
C:/mingw-w64/x86_64/mingw64/x86_64-w64-
mingw32/include/string.h:119:Quoted 3 lines
note: this is the location of the previous definition #define strncasecmp
_strnicmpQuoted 7 lines
Quoted 4 lines
I'm using:
(quoted diff) +0
-2-gcc (x86_64-win32-seh-rev0, Built by MinGW-W64 project) 8.1.0 -meson0.53.2
I can't reproduce it using the same versions.
Do you invoke meson with other options than "-Dexamples=..."?Quoted 7 lines
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.hdefines 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]Quoted 3 lines
#define open(path, flags, ...) _open(path, flags, ##__VA_ARGS__) ^However don't see it in CI, I'm using clang version 9.0.1
Quoted 2 lines
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.
2021-04-19 15:29 (UTC-0400), Aaron Conole:
Quoted 62 lines
Quoted 57 lines · Thomas Monjalon
19/04/2021 20:06, Tal Shnaiderman:
Quoted 52 lines
Quoted 33 lines
Quoted 25 lines
2021-04-18 19:04 (UTC+0000), Tal Shnaiderman:
Quoted 5 lines
Quoted 5 lines
18/04/2021 19:08, Tal Shnaiderman:
Quoted 4 lines
the strncasecmp marco defined in
rte_os_shim.his already defined in MinGW-w64, as a result the compiler prints out the warning below on function redefinition whenever compiling a file including theheader.
Quoted 9 lines
Quoted 6 lines
Quoted 4 lines
..\lib/librte_eal/windows/include/rte_os_shim.h:21:
warning: "strncasecmp" redefined #definestrncasecmp(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?
Quoted 4 lines
On my side the collision is with the following file:
C:/mingw-w64/x86_64/mingw64/x86_64-w64-
mingw32/include/string.h:119:Quoted 3 lines
note: this is the location of the previous definition #define strncasecmp
_strnicmpQuoted 7 lines
Quoted 4 lines
I'm using:
(quoted diff) +0
-2-gcc (x86_64-win32-seh-rev0, Built by MinGW-W64 project) 8.1.0 -meson0.53.2
I can't reproduce it using the same versions.
Do you invoke meson with other options than "-Dexamples=..."?Quoted 7 lines
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.hdefines 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]Quoted 3 lines
#define open(path, flags, ...) _open(path, flags, ##__VA_ARGS__) ^However don't see it in CI, I'm using clang version 9.0.1
Quoted 2 lines
It seems we should improve our CI.
Please open suggestions in the CI bugzilla.
Quoted 6 lines
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.
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
Quoted 85 lines · Dmitry Kozlyuk
2021-04-19 15:29 (UTC-0400), Aaron Conole:
Quoted 7 lines
Quoted 5 lines · Thomas Monjalon
19/04/2021 20:06, Tal Shnaiderman:
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
2021-04-18 19:04 (UTC+0000), Tal Shnaiderman:
Quoted 3 lines
Quoted 3 lines
18/04/2021 19:08, Tal Shnaiderman:
Quoted 2 lines
the strncasecmp marco defined in
rte_os_shim.his already defined in MinGW-w64, as a result the compiler prints outthe
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
warning below on function redefinition whenever compiling a
file
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
including the
header.
Quoted 6 lines
Quoted 6 lines
Quoted 4 lines
..\lib/librte_eal/windows/include/rte_os_shim.h:21:
warning: "strncasecmp" redefined #definestrncasecmp(s1, s2, count)_strnicmp(s1, s2, count)Why the tests are passing? Are we allowing warnings in build
test?
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
It's a good question, I see CI is passing without warnings,
Dmitry
Quoted 18 lines
Quoted 18 lines
Quoted 18 lines
Quoted 18 lines
Quoted 17 lines
Quoted 1 line
can you
reproduce it?
Quoted 4 lines
On my side the collision is with the following file:
C:/mingw-w64/x86_64/mingw64/x86_64-w64-
mingw32/include/string.h:119:Quoted 7 lines
note: this is the location of the previous definition #define strncasecmp
_strnicmpI'm using:
(quoted diff) +0
-2-gcc (x86_64-win32-seh-rev0, Built by MinGW-W64 project) 8.1.0 -meson0.53.2
I can't reproduce it using the same versions.
Do you invoke meson with other options than "-Dexamples=..."?Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
This is the meson line I'm using:
meson "-Dexamples=helloworld" build --wipe --default-library=static
--
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
buildtype debug
The problem however is that MinGW's
string.hdefines the macro inline 119,
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 1 line
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:Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
[185/314] Compiling C object
drivers/a715181@@tmp_rte_common_mlx5@sta/common_mlx5_mlx5_common_mp.c.obj.
Quoted 13 lines
Quoted 10 lines
Quoted 9 lines
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
Quoted 2 lines
It seems we should improve our CI.
Please open suggestions in the CI bugzilla.Quoted 6 lines
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.
Signature · 7 lines
*Lincoln Lavoie* Principal Engineer, Broadband Technologies 21 Madbury Rd., Ste. 100, Durham, NH 03824 [email protected] https://www.iol.unh.edu +1-603-674-2755 (m) <https://www.iol.unh.edu>
Quoted 80 lines
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:
Quoted 9 lines
Quoted 7 lines · Thomas Monjalon
19/04/2021 20:06, Tal Shnaiderman:
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
2021-04-18 19:04 (UTC+0000), Tal Shnaiderman:
Quoted 5 lines
Quoted 5 lines
18/04/2021 19:08, Tal Shnaiderman:
Quoted 4 lines
the strncasecmp marco defined in
rte_os_shim.his already defined in MinGW-w64, as a result the compiler prints out the warning below on function redefinition whenever compiling a file including theQuoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
header.
Quoted 7 lines
Quoted 7 lines
Quoted 5 lines
..\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?
Quoted 25 lines
Quoted 25 lines
Quoted 25 lines
Quoted 25 lines
Quoted 12 lines
Quoted 3 lines
It's a good question, I see CI is passing without warnings, Dmitry can you
reproduce it?
Quoted 4 lines
On my side the collision is with the following file:
C:/mingw-w64/x86_64/mingw64/x86_64-w64-
mingw32/include/string.h:119:Quoted 3 lines
note: this is the location of the previous definition #define strncasecmp
_strnicmpQuoted 7 lines
Quoted 4 lines
I'm using:
-gcc (x86_64-win32-seh-rev0, Built by MinGW-W64 project) 8.1.0 -meson
0.53.2I 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 debugQuoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 2 lines
The problem however is that MinGW's
string.hdefines 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:Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
[185/314] Compiling C object
drivers/a715181@@tmp_rte_common_mlx5@sta/common_mlx5_mlx5_common_mp.c.obj.Quoted 13 lines
Quoted 10 lines
Quoted 9 lines
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]
#defineopen(path, flags, ...)_open(path, flags, ##__VA_ARGS__)
^ However don't
see it in CI, I'm using clang version 9.0.1Quoted 2 lines
It seems we should improve our CI.
Please open suggestions in the CI bugzilla.Quoted 6 lines
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.
Quoted 6 lines
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?
Hi Tal,
2021-04-19 18:06 (UTC+0000), Tal Shnaiderman:
Quoted 10 lines
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.
2021-04-19 06:57 (UTC+0000), Tal Shnaiderman:
Quoted 27 lines
[...]
Quoted 26 lines
Quoted 4 lines
Quoted 4 lines
18/04/2021 19:08, Tal Shnaiderman:
Quoted 3 lines
the strncasecmp marco defined in
rte_os_shim.his already defined in MinGW-w64, as a result the compiler prints out the warning below on function redefinition whenever compiling a file including theheader.
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
..\lib/librte_eal/windows/include/rte_os_shim.h:21:
warning: "strncasecmp" redefined
#definestrncasecmp(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?
Quoted 4 lines
On my side the collision is with the following file:
C:/mingw-w64/x86_64/mingw64/x86_64-w64-
mingw32/include/string.h:119:Quoted 6 lines
note: this is the location of the previous definition #define strncasecmp
_strnicmpI'm using:
-gcc (x86_64-win32-seh-rev0, Built by MinGW-W64 project) 8.1.0 -meson 0.53.2
Quoted 8 lines
Quoted 2 lines
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.hdefines 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.
PATCH v2 1/1 eal/windows: fix build warnings in MinGW
In reply to Tal Shnaidermanthe 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.
---
v2: fix commit message typo [Thomas]
--- lib/librte_eal/windows/include/rte_os_shim.h | 2 ++ 1 file changed, 2 insertions(+)
lib/librte_eal/windows/include/rte_os_shim.h +2 -0
@@ -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)
Signature · 1 line
2.16.1.windows.4
2021-04-21 19:09 (UTC+0300), Tal Shnaiderman:
Quoted 9 lines
the strncasecmp macro defined in
rte_os_shim.his 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
#definestrncasecmp(s1, s2, count)_strnicmp(s1, s2, count)
Quoted 5 lines
Fixed by defining the macro only to the clang compiler.
Fixes 45d62067c237 ("eal: make OS shims internal")Signed-off-by Tal Shnaiderman <[email protected]>
With librte_eal -> eal fixup,
Thomas Monjalon
Applied26/04/2021 17:58, Dmitry Kozlyuk:
Quoted 10 lines
2021-04-21 19:09 (UTC+0300), Tal Shnaiderman:
Quoted 9 lines
the strncasecmp macro defined in
rte_os_shim.his 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
#definestrncasecmp(s1, s2, count)_strnicmp(s1, s2, count)
Quoted 8 lines
Quoted 5 lines
Fixed by defining the macro only to the clang compiler.
Fixes 45d62067c237 ("eal: make OS shims internal")Signed-off-by Tal Shnaiderman <[email protected]>With
librte_eal-> eal fixup,Acked-by Dmitry Kozlyuk <[email protected]>
Applied, thanks.