* [dpdk-dev] [PATCH] windows: build warnings with clang
@ 2020-11-27 11:36 Nick Connolly
2020-11-29 15:38 ` Dmitry Kozlyuk
2020-11-29 16:00 ` [dpdk-dev] [PATCH v2] " Nick Connolly
0 siblings, 2 replies; 8+ messages in thread
From: Nick Connolly @ 2020-11-27 11:36 UTC (permalink / raw)
To: Bruce Richardson; +Cc: dev, David Marchand, Nick Connolly
Compiling with Clang (11.0, --buildtype=debug) for Windows
produces deprecated warnings related to secure crt functions.
Disable this by defining -D_CRT_SECURE_NO_WARNINGS.
It is unclear exactly which commit this fixes. It is probably a
consequence of building more libraries for Windows.
Signed-off-by: Nick Connolly <nick.connolly@mayadata.io>
---
config/meson.build | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/config/meson.build b/config/meson.build
index c02802c18..a3154e29c 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -279,6 +279,11 @@ if is_windows
add_project_arguments('-D__USE_MINGW_ANSI_STDIO', language: 'c')
endif
+ # Disable secure CRT deprecated warnings for clang
+ if cc.get_id() == 'clang'
+ add_project_arguments('-D_CRT_SECURE_NO_WARNINGS', language: 'c')
+ endif
+
add_project_link_arguments('-lws2_32', language: 'c')
# Contrary to docs, VirtualAlloc2() is exported by mincore.lib
--
2.25.1
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [dpdk-dev] [PATCH] windows: build warnings with clang
2020-11-27 11:36 [dpdk-dev] [PATCH] windows: build warnings with clang Nick Connolly
@ 2020-11-29 15:38 ` Dmitry Kozlyuk
2020-11-29 16:00 ` [dpdk-dev] [PATCH v2] " Nick Connolly
1 sibling, 0 replies; 8+ messages in thread
From: Dmitry Kozlyuk @ 2020-11-29 15:38 UTC (permalink / raw)
To: Nick Connolly; +Cc: Bruce Richardson, dev, David Marchand
On Fri, 27 Nov 2020 11:36:23 +0000, Nick Connolly wrote:
> Compiling with Clang (11.0, --buildtype=debug) for Windows
> produces deprecated warnings related to secure crt functions.
Please explain what these warnings mean and why disabling them is OK.
FWIW, I examined present warnings and found no useful ones. Also,
--buildtype=debug is not necessary to trigger these warnings.
Proposed wording (feel free to adjust):
Microsoft CRT defines Windows-specific secure alternatives to
standard library functions and triggers warnings when "insecure"
functions are used [1]. However, calling code already has all
necessary checks around those functions, so these warnings are not
useful for DPDK. MinGW provides its own CRT without this issue.
[1]:
https://docs.microsoft.com/en-us/cpp/c-runtime-library/security-features-in-the-crt?view=msvc-160
> Disable this by defining -D_CRT_SECURE_NO_WARNINGS.
>
> It is unclear exactly which commit this fixes. It is probably a
> consequence of building more libraries for Windows.
Tip: Unless you want to make this paragraph part of the commit, you can write
such notices below "---" line, like version info.
>
> Signed-off-by: Nick Connolly <nick.connolly@mayadata.io>
> ---
> config/meson.build | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/config/meson.build b/config/meson.build
> index c02802c18..a3154e29c 100644
> --- a/config/meson.build
> +++ b/config/meson.build
> @@ -279,6 +279,11 @@ if is_windows
> add_project_arguments('-D__USE_MINGW_ANSI_STDIO', language: 'c')
> endif
>
> + # Disable secure CRT deprecated warnings for clang
> + if cc.get_id() == 'clang'
> + add_project_arguments('-D_CRT_SECURE_NO_WARNINGS', language: 'c')
> + endif
> +
> add_project_link_arguments('-lws2_32', language: 'c')
>
> # Contrary to docs, VirtualAlloc2() is exported by mincore.lib
^ permalink raw reply [flat|nested] 8+ messages in thread
* [dpdk-dev] [PATCH v2] windows: build warnings with clang
2020-11-27 11:36 [dpdk-dev] [PATCH] windows: build warnings with clang Nick Connolly
2020-11-29 15:38 ` Dmitry Kozlyuk
@ 2020-11-29 16:00 ` Nick Connolly
2020-12-03 0:02 ` Dmitry Kozlyuk
2020-12-05 0:46 ` Kadam, Pallavi
1 sibling, 2 replies; 8+ messages in thread
From: Nick Connolly @ 2020-11-29 16:00 UTC (permalink / raw)
To: Bruce Richardson; +Cc: dev, David Marchand, Dmitry Kozlyuk, Nick Connolly
Microsoft CRT defines Windows-specific secure alternatives to
standard library functions and triggers warnings when "insecure"
functions are used [1]. However, calling code already has all
necessary checks around those functions, so these warnings are not
useful for DPDK. MinGW provides its own CRT without this issue.
[1]:
https://docs.microsoft.com/en-us/cpp/c-runtime-library/security-features-in-the-crt?view=msvc-160
Disable this by defining -D_CRT_SECURE_NO_WARNINGS.
Signed-off-by: Nick Connolly <nick.connolly@mayadata.io>
---
v2:
* Adjust commit wording as per Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
Note: It is unclear exactly which commit this fixes. It is probably a
consequence of building more libraries for Windows.
config/meson.build | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/config/meson.build b/config/meson.build
index c02802c18..a3154e29c 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -279,6 +279,11 @@ if is_windows
add_project_arguments('-D__USE_MINGW_ANSI_STDIO', language: 'c')
endif
+ # Disable secure CRT deprecated warnings for clang
+ if cc.get_id() == 'clang'
+ add_project_arguments('-D_CRT_SECURE_NO_WARNINGS', language: 'c')
+ endif
+
add_project_link_arguments('-lws2_32', language: 'c')
# Contrary to docs, VirtualAlloc2() is exported by mincore.lib
--
2.25.1
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [dpdk-dev] [PATCH v2] windows: build warnings with clang
2020-11-29 16:00 ` [dpdk-dev] [PATCH v2] " Nick Connolly
@ 2020-12-03 0:02 ` Dmitry Kozlyuk
2020-12-07 20:34 ` Thomas Monjalon
2020-12-05 0:46 ` Kadam, Pallavi
1 sibling, 1 reply; 8+ messages in thread
From: Dmitry Kozlyuk @ 2020-12-03 0:02 UTC (permalink / raw)
To: Nick Connolly; +Cc: Bruce Richardson, dev, David Marchand
On Sun, 29 Nov 2020 16:00:24 +0000, Nick Connolly wrote:
> Microsoft CRT defines Windows-specific secure alternatives to
> standard library functions and triggers warnings when "insecure"
> functions are used [1]. However, calling code already has all
> necessary checks around those functions, so these warnings are not
> useful for DPDK. MinGW provides its own CRT without this issue.
>
> [1]:
> https://docs.microsoft.com/en-us/cpp/c-runtime-library/security-features-in-the-crt?view=msvc-160
>
> Disable this by defining -D_CRT_SECURE_NO_WARNINGS.
>
> Signed-off-by: Nick Connolly <nick.connolly@mayadata.io>
> ---
> v2:
> * Adjust commit wording as per Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
>
> Note: It is unclear exactly which commit this fixes. It is probably a
> consequence of building more libraries for Windows.
Acked-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [dpdk-dev] [PATCH v2] windows: build warnings with clang
2020-12-03 0:02 ` Dmitry Kozlyuk
@ 2020-12-07 20:34 ` Thomas Monjalon
2020-12-09 9:30 ` Nick Connolly
0 siblings, 1 reply; 8+ messages in thread
From: Thomas Monjalon @ 2020-12-07 20:34 UTC (permalink / raw)
To: Nick Connolly
Cc: dev, Bruce Richardson, David Marchand, Dmitry Kozlyuk, pallavi.kadam
03/12/2020 01:02, Dmitry Kozlyuk:
> On Sun, 29 Nov 2020 16:00:24 +0000, Nick Connolly wrote:
> > Microsoft CRT defines Windows-specific secure alternatives to
> > standard library functions and triggers warnings when "insecure"
> > functions are used [1]. However, calling code already has all
> > necessary checks around those functions, so these warnings are not
> > useful for DPDK. MinGW provides its own CRT without this issue.
> >
> > [1]:
> > https://docs.microsoft.com/en-us/cpp/c-runtime-library/security-features-in-the-crt?view=msvc-160
> >
> > Disable this by defining -D_CRT_SECURE_NO_WARNINGS.
> >
> > Signed-off-by: Nick Connolly <nick.connolly@mayadata.io>
> > ---
> > v2:
> > * Adjust commit wording as per Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
> >
> > Note: It is unclear exactly which commit this fixes. It is probably a
> > consequence of building more libraries for Windows.
>
> Acked-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
Applied, thanks
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [dpdk-dev] [PATCH v2] windows: build warnings with clang
2020-12-07 20:34 ` Thomas Monjalon
@ 2020-12-09 9:30 ` Nick Connolly
2021-12-12 12:06 ` Xueming(Steven) Li
0 siblings, 1 reply; 8+ messages in thread
From: Nick Connolly @ 2020-12-09 9:30 UTC (permalink / raw)
To: Thomas Monjalon
Cc: dev, Bruce Richardson, David Marchand, Dmitry Kozlyuk,
pallavi.kadam, stable
Copying stable@dpdk.org - given that 20.11 has now been released I
assume this needs to be applied there as well.
On 07/12/2020 20:34, Thomas Monjalon wrote:
> 03/12/2020 01:02, Dmitry Kozlyuk:
>> On Sun, 29 Nov 2020 16:00:24 +0000, Nick Connolly wrote:
>>> Microsoft CRT defines Windows-specific secure alternatives to
>>> standard library functions and triggers warnings when "insecure"
>>> functions are used [1]. However, calling code already has all
>>> necessary checks around those functions, so these warnings are not
>>> useful for DPDK. MinGW provides its own CRT without this issue.
>>>
>>> [1]:
>>> https://docs.microsoft.com/en-us/cpp/c-runtime-library/security-features-in-the-crt?view=msvc-160
>>>
>>> Disable this by defining -D_CRT_SECURE_NO_WARNINGS.
>>>
>>> Signed-off-by: Nick Connolly <nick.connolly@mayadata.io>
>>> ---
>>> v2:
>>> * Adjust commit wording as per Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
>>>
>>> Note: It is unclear exactly which commit this fixes. It is probably a
>>> consequence of building more libraries for Windows.
>> Acked-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
> Applied, thanks
>
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [dpdk-dev] [PATCH v2] windows: build warnings with clang
2020-12-09 9:30 ` Nick Connolly
@ 2021-12-12 12:06 ` Xueming(Steven) Li
0 siblings, 0 replies; 8+ messages in thread
From: Xueming(Steven) Li @ 2021-12-12 12:06 UTC (permalink / raw)
To: NBU-Contact-Thomas Monjalon (EXTERNAL), nick.connolly
Cc: pallavi.kadam, dev, david.marchand, dmitry.kozliuk,
bruce.richardson, stable
On Wed, 2020-12-09 at 09:30 +0000, Nick Connolly wrote:
> Copying stable@dpdk.org - given that 20.11 has now been released I
> assume this needs to be applied there as well.
This patch was ignored due to the backport scanning scripts check
commit message from upstream git repo, not mail thread. Remember to add
"Cc: stable@dpdk.org" in message body, or a "Fixes" tag.
Applied to 20.11.4 now.
>
> On 07/12/2020 20:34, Thomas Monjalon wrote:
> > 03/12/2020 01:02, Dmitry Kozlyuk:
> > > On Sun, 29 Nov 2020 16:00:24 +0000, Nick Connolly wrote:
> > > > Microsoft CRT defines Windows-specific secure alternatives to
> > > > standard library functions and triggers warnings when "insecure"
> > > > functions are used [1]. However, calling code already has all
> > > > necessary checks around those functions, so these warnings are not
> > > > useful for DPDK. MinGW provides its own CRT without this issue.
> > > >
> > > > [1]:
> > > > https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fcpp%2Fc-runtime-library%2Fsecurity-features-in-the-crt%3Fview%3Dmsvc-160&data=04%7C01%7Cxuemingl%40nvidia.com%7C93c0adf5be2246c07dcf08d89c2532f5%7C43083d15727340c1b7db39efd9ccc17a%7C0%7C0%7C637431030883808802%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=LJVdh0nUgUEXT9vukPmwPffPugpiDFhe7EWp2rU7DuQ%3D&reserved=0
> > > >
> > > > Disable this by defining -D_CRT_SECURE_NO_WARNINGS.
> > > >
> > > > Signed-off-by: Nick Connolly <nick.connolly@mayadata.io>
> > > > ---
> > > > v2:
> > > > * Adjust commit wording as per Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
> > > >
> > > > Note: It is unclear exactly which commit this fixes. It is probably a
> > > > consequence of building more libraries for Windows.
> > > Acked-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
> > Applied, thanks
> >
> >
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [dpdk-dev] [PATCH v2] windows: build warnings with clang
2020-11-29 16:00 ` [dpdk-dev] [PATCH v2] " Nick Connolly
2020-12-03 0:02 ` Dmitry Kozlyuk
@ 2020-12-05 0:46 ` Kadam, Pallavi
1 sibling, 0 replies; 8+ messages in thread
From: Kadam, Pallavi @ 2020-12-05 0:46 UTC (permalink / raw)
To: Nick Connolly, Bruce Richardson; +Cc: dev, David Marchand, Dmitry Kozlyuk
Hi Nick,
Thanks for this patch. Could not see the deprecated warnings anymore.
On 11/29/2020 8:00 AM, Nick Connolly wrote:
> Microsoft CRT defines Windows-specific secure alternatives to
> standard library functions and triggers warnings when "insecure"
> functions are used [1]. However, calling code already has all
> necessary checks around those functions, so these warnings are not
> useful for DPDK. MinGW provides its own CRT without this issue.
>
> [1]:
> https://docs.microsoft.com/en-us/cpp/c-runtime-library/security-features-in-the-crt?view=msvc-160
>
> Disable this by defining -D_CRT_SECURE_NO_WARNINGS.
>
> Signed-off-by: Nick Connolly <nick.connolly@mayadata.io>
> ---
Acked-by: Pallavi Kadam <pallavi.kadam@intel.com>
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2021-12-12 12:06 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-27 11:36 [dpdk-dev] [PATCH] windows: build warnings with clang Nick Connolly
2020-11-29 15:38 ` Dmitry Kozlyuk
2020-11-29 16:00 ` [dpdk-dev] [PATCH v2] " Nick Connolly
2020-12-03 0:02 ` Dmitry Kozlyuk
2020-12-07 20:34 ` Thomas Monjalon
2020-12-09 9:30 ` Nick Connolly
2021-12-12 12:06 ` Xueming(Steven) Li
2020-12-05 0:46 ` Kadam, Pallavi
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).