https://git.reactos.org/?p=reactos.git;a=commitdiff;h=ad89837c0eeacbc20326b…
commit ad89837c0eeacbc20326b7c4b588d2bf59718dee
Author: Timo Kreuzer <timo.kreuzer(a)reactos.org>
AuthorDate: Sat Jul 20 17:34:24 2019 +0200
Commit: Timo Kreuzer <timo.kreuzer(a)reactos.org>
CommitDate: Thu Aug 15 15:24:12 2019 +0200
[3RDPARTY] Suppress MSVC printf format warnings in 3rd-party code
---
base/applications/wordpad/CMakeLists.txt | 5 +++++
base/services/nfsd/CMakeLists.txt | 5 +++++
dll/3rdparty/libtirpc/CMakeLists.txt | 3 +++
dll/win32/atl/CMakeLists.txt | 5 +++++
dll/win32/comctl32/CMakeLists.txt | 5 +++++
dll/win32/dbghelp/CMakeLists.txt | 5 +++++
modules/rostests/winetests/kernel32/CMakeLists.txt | 5 +++++
modules/rostests/winetests/msvcrt/CMakeLists.txt | 5 +++++
modules/rostests/winetests/oleacc/CMakeLists.txt | 5 +++++
modules/rostests/winetests/user32/CMakeLists.txt | 5 +++++
10 files changed, 48 insertions(+)
diff --git a/base/applications/wordpad/CMakeLists.txt
b/base/applications/wordpad/CMakeLists.txt
index 652ca7cbdc5..80d9117a270 100644
--- a/base/applications/wordpad/CMakeLists.txt
+++ b/base/applications/wordpad/CMakeLists.txt
@@ -4,6 +4,11 @@ remove_definitions(-D_WIN32_IE=0x600)
add_definitions(-D__ROS_LONG64__)
include_directories(BEFORE ${REACTOS_SOURCE_DIR}/sdk/include/reactos/wine)
+if (MSVC)
+ # Disable warning C4477 (printf format warnings)
+ add_compile_flags("/wd4477")
+endif()
+
list(APPEND SOURCE
olecallback.c
print.c
diff --git a/base/services/nfsd/CMakeLists.txt b/base/services/nfsd/CMakeLists.txt
index 3ab680be23e..f0451522686 100644
--- a/base/services/nfsd/CMakeLists.txt
+++ b/base/services/nfsd/CMakeLists.txt
@@ -7,6 +7,11 @@ include_directories(
${REACTOS_SOURCE_DIR}/drivers/filesystems/nfs
${REACTOS_SOURCE_DIR}/dll/np/nfs)
+if (MSVC)
+ # Disable warning C4477 (printf format warnings)
+ add_compile_flags("/wd4477")
+endif()
+
list(APPEND SOURCE
acl.c
callback_server.c
diff --git a/dll/3rdparty/libtirpc/CMakeLists.txt b/dll/3rdparty/libtirpc/CMakeLists.txt
index dd636c99289..1cadd650861 100644
--- a/dll/3rdparty/libtirpc/CMakeLists.txt
+++ b/dll/3rdparty/libtirpc/CMakeLists.txt
@@ -9,6 +9,9 @@ include_directories(${REACTOS_SOURCE_DIR}/dll/3rdparty/libtirpc/tirpc)
if(MSVC)
# error C4133: '=': incompatible types - from 'char *' to
'int32_t *'
replace_compile_flags("/we4133" " ")
+
+ # Disable warning C4477 (printf format warnings)
+ add_compile_flags("/wd4313")
endif()
list(APPEND SOURCE
diff --git a/dll/win32/atl/CMakeLists.txt b/dll/win32/atl/CMakeLists.txt
index 475ebab24ff..ac492112eeb 100644
--- a/dll/win32/atl/CMakeLists.txt
+++ b/dll/win32/atl/CMakeLists.txt
@@ -9,6 +9,11 @@ add_definitions(
include_directories(${REACTOS_SOURCE_DIR}/sdk/include/reactos/wine)
spec2def(atl.dll atl.spec ADD_IMPORTLIB)
+if(MSVC)
+ # Disable warning C4477 (printf format warnings)
+ add_compile_flags("/wd4477")
+endif()
+
list(APPEND SOURCE
atl.c
atl30.c
diff --git a/dll/win32/comctl32/CMakeLists.txt b/dll/win32/comctl32/CMakeLists.txt
index 8c05f33e6e1..f6f22daa569 100644
--- a/dll/win32/comctl32/CMakeLists.txt
+++ b/dll/win32/comctl32/CMakeLists.txt
@@ -10,6 +10,11 @@ add_definitions(-D_WIN32_WINNT=0x600 -DWINVER=0x600)
include_directories(BEFORE ${REACTOS_SOURCE_DIR}/sdk/include/reactos/wine)
spec2def(comctl32.dll comctl32.spec ADD_IMPORTLIB)
+if(MSVC)
+ # Disable warning C4477 (printf format warnings)
+ add_compile_flags("/wd4477")
+endif()
+
list(APPEND SOURCE
animate.c
button.c
diff --git a/dll/win32/dbghelp/CMakeLists.txt b/dll/win32/dbghelp/CMakeLists.txt
index 27b44e32cae..319d38c0e80 100644
--- a/dll/win32/dbghelp/CMakeLists.txt
+++ b/dll/win32/dbghelp/CMakeLists.txt
@@ -1,4 +1,9 @@
+if(MSVC)
+ # Disable warning C4477 (printf format warnings)
+ add_compile_flags("/wd4477")
+endif()
+
if(NOT CMAKE_CROSSCOMPILING)
add_definitions(-DDBGHELP_STATIC_LIB)
diff --git a/modules/rostests/winetests/kernel32/CMakeLists.txt
b/modules/rostests/winetests/kernel32/CMakeLists.txt
index a33f10d99a1..619e4407720 100644
--- a/modules/rostests/winetests/kernel32/CMakeLists.txt
+++ b/modules/rostests/winetests/kernel32/CMakeLists.txt
@@ -3,6 +3,11 @@ include_directories(BEFORE
${REACTOS_SOURCE_DIR}/sdk/include/reactos/wine)
remove_definitions(-DWINVER=0x502 -D_WIN32_IE=0x600 -D_WIN32_WINNT=0x502)
add_definitions(-DWINVER=0x600 -D_WIN32_WINNT=0x601)
+if(MSVC)
+ # Disable warning C4477 (printf format warnings)
+ add_compile_flags("/wd4477")
+endif()
+
list(APPEND SOURCE
actctx.c
atom.c
diff --git a/modules/rostests/winetests/msvcrt/CMakeLists.txt
b/modules/rostests/winetests/msvcrt/CMakeLists.txt
index c456d9c0038..359fb2aa674 100644
--- a/modules/rostests/winetests/msvcrt/CMakeLists.txt
+++ b/modules/rostests/winetests/msvcrt/CMakeLists.txt
@@ -4,6 +4,11 @@ add_definitions(
-D_CRT_NONSTDC_NO_DEPRECATE
-D__msvcrt_ulong=ULONG)
+if(MSVC)
+ # Disable warning C4477 (printf format warnings)
+ add_compile_flags("/wd4477")
+endif()
+
list(APPEND SOURCE
cpp.c
data.c
diff --git a/modules/rostests/winetests/oleacc/CMakeLists.txt
b/modules/rostests/winetests/oleacc/CMakeLists.txt
index 31181220aca..5e645917efe 100644
--- a/modules/rostests/winetests/oleacc/CMakeLists.txt
+++ b/modules/rostests/winetests/oleacc/CMakeLists.txt
@@ -1,4 +1,9 @@
+if(MSVC)
+ # Disable warning C4477 (printf format warnings)
+ add_compile_flags("/wd4477")
+endif()
+
add_executable(oleacc_winetest main.c testlist.c)
set_module_type(oleacc_winetest win32cui)
target_link_libraries(oleacc_winetest uuid)
diff --git a/modules/rostests/winetests/user32/CMakeLists.txt
b/modules/rostests/winetests/user32/CMakeLists.txt
index fc73d16b5fc..8c6f769c95f 100644
--- a/modules/rostests/winetests/user32/CMakeLists.txt
+++ b/modules/rostests/winetests/user32/CMakeLists.txt
@@ -2,6 +2,11 @@
remove_definitions(-DWINVER=0x502 -D_WIN32_WINNT=0x502)
add_definitions(-DWINVER=0x600 -D_WIN32_WINNT=0x600)
+if(MSVC)
+ # Disable warning C4477 (printf format warnings)
+ add_compile_flags("/wd4477")
+endif()
+
list(APPEND SOURCE
broadcast.c
class.c