From ecc69f98c7e3dd5ecab94047edb65ccff0dce5b9 Mon Sep 17 00:00:00 2001 From: Nick Connolly Date: Sun, 29 Nov 2020 16:00:24 +0000 Subject: [PATCH] build: disable Windows warnings for insecure funtions 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 Acked-by: Dmitry Kozlyuk Acked-by: Pallavi Kadam --- config/meson.build | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/config/meson.build b/config/meson.build index c02802c18e..a3154e29c3 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.20.1