mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +00:00
[REACTOS] Silence warnings in 3r-party code
This commit is contained in:
parent
5d8e834897
commit
41bc57ddf0
33 changed files with 145 additions and 31 deletions
|
@ -38,3 +38,8 @@ set_module_type(mstsc win32gui UNICODE)
|
|||
add_importlibs(mstsc user32 gdi32 comctl32 ws2_32 crypt32 secur32 advapi32 shell32 ole32 comdlg32 msvcrt kernel32)
|
||||
add_pch(mstsc precomp.h SOURCE)
|
||||
add_cd_file(TARGET mstsc DESTINATION reactos/system32 FOR all)
|
||||
|
||||
if(MSVC)
|
||||
# Disable warning C4267: 'initializing': conversion from 'size_t' to 'uint16', possible loss of data
|
||||
target_compile_options(mstsc PRIVATE /wd4267)
|
||||
endif()
|
||||
|
|
|
@ -25,6 +25,12 @@ add_executable(telnet ${SOURCE} telnet.rc)
|
|||
target_link_libraries(telnet cppstl)
|
||||
set_target_cpp_properties(telnet WITH_EXCEPTIONS)
|
||||
|
||||
if (MSVC)
|
||||
# C4838: conversion from 'int' to 'SHORT' requires a narrowing conversion
|
||||
# C4996: 'strnicmp': Deprecated POSIX name, Try _strnicmp instead!
|
||||
target_compile_options(telnet PRIVATE /wd4838 /wd4996)
|
||||
endif()
|
||||
|
||||
if (NOT MSVC)
|
||||
target_compile_definitions(telnet PRIVATE _CRT_NONSTDC_NO_DEPRECATE)
|
||||
endif()
|
||||
|
|
|
@ -50,7 +50,7 @@ add_executable(nfsd ${SOURCE} nfsd.rc)
|
|||
|
||||
if(MSVC AND (NOT USE_CLANG_CL))
|
||||
# Disable warning C4477 (printf format warnings)
|
||||
remove_target_compile_option(nfsd "/we4477")
|
||||
target_compile_options(nfsd PRIVATE /wd4477)
|
||||
else()
|
||||
# FIXME: Tons of warnings.
|
||||
target_compile_options(nfsd PRIVATE "-w")
|
||||
|
|
|
@ -4,6 +4,11 @@ set_module_type(tftpd win32cui)
|
|||
add_importlibs(tftpd advapi32 ws2_32 iphlpapi msvcrt kernel32)
|
||||
add_cd_file(TARGET tftpd DESTINATION reactos/system32 FOR all)
|
||||
|
||||
if (MSVC)
|
||||
# Disable warning C4267: 'initializing': conversion from 'size_t' to 'unsigned short', possible loss of data
|
||||
target_compile_options(tftpd PRIVATE /wd4267)
|
||||
endif()
|
||||
|
||||
if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
|
||||
target_compile_options(tftpd PRIVATE -Wno-format-overflow)
|
||||
endif()
|
||||
|
|
10
dll/3rdparty/libtirpc/CMakeLists.txt
vendored
10
dll/3rdparty/libtirpc/CMakeLists.txt
vendored
|
@ -94,14 +94,10 @@ add_library(libtirpc MODULE
|
|||
${CMAKE_CURRENT_BINARY_DIR}/libtirpc.def)
|
||||
|
||||
if(MSVC)
|
||||
# error C4133: '=': incompatible types - from 'char *' to 'int32_t *'
|
||||
remove_target_compile_option(libtirpc "/we4133")
|
||||
# Disable warning C4313 (format string conflicts)
|
||||
remove_target_compile_option(libtirpc "/we4313")
|
||||
# Disable warning C4477 (printf format warnings)
|
||||
remove_target_compile_option(libtirpc "/we4477")
|
||||
# Disable warning C4273: 'strtok_s': inconsistent dll linkage
|
||||
# Disable warning C4313: 'fprintf': '%x' in format string conflicts with argument 2 of type 'HANDLE'
|
||||
target_compile_options(libtirpc PRIVATE /wd4273 /wd4313)
|
||||
if (NOT USE_CLANG_CL)
|
||||
remove_target_compile_option(libtirpc "/we4101")
|
||||
target_compile_options(libtirpc PRIVATE /wd4101 /wd4133 /wd4473 /wd4477)
|
||||
endif()
|
||||
else()
|
||||
|
|
|
@ -1,4 +1,10 @@
|
|||
|
||||
if (MSVC)
|
||||
# Disable warning C4090: 'function': different 'const' qualifiers
|
||||
# Disable warning C4146: unary minus operator applied to unsigned type, result still unsigned
|
||||
add_compile_options(/wd4090 /wd4146)
|
||||
endif()
|
||||
|
||||
add_subdirectory(amstream)
|
||||
add_subdirectory(d3d8)
|
||||
add_subdirectory(d3d9)
|
||||
|
|
|
@ -30,6 +30,11 @@ add_library(avifil32 MODULE
|
|||
${CMAKE_CURRENT_BINARY_DIR}/proxy.dlldata.c
|
||||
${CMAKE_CURRENT_BINARY_DIR}/avifil32.def)
|
||||
|
||||
if(MSVC)
|
||||
# Disable warning C4146: unary minus operator applied to unsigned type, result still unsigned
|
||||
target_compile_options(avifil32 PRIVATE /wd4146)
|
||||
endif()
|
||||
|
||||
set_module_type(avifil32 win32dll)
|
||||
target_link_libraries(avifil32 wine ${PSEH_LIB})
|
||||
add_importlibs(avifil32 msacm32 msvfw32 winmm ole32 user32 advapi32 rpcrt4 msvcrt kernel32 ntdll)
|
||||
|
|
|
@ -65,8 +65,10 @@ add_library(comctl32 MODULE
|
|||
${CMAKE_CURRENT_BINARY_DIR}/comctl32.def)
|
||||
|
||||
if(MSVC)
|
||||
# Disable warning C4146: unary minus operator applied to unsigned type, result still unsigned
|
||||
# Disable warning C4267: '=': conversion from 'size_t' to 'WORD', possible loss of data
|
||||
# Disable warning C4477 (printf format warnings)
|
||||
remove_target_compile_option(comctl32 "/we4477")
|
||||
target_compile_options(comctl32 PRIVATE /wd4146 /wd4267 /wd4477)
|
||||
endif()
|
||||
|
||||
set_module_type(comctl32 win32dll UNICODE)
|
||||
|
|
|
@ -47,8 +47,9 @@ add_library(crypt32 MODULE
|
|||
${CMAKE_CURRENT_BINARY_DIR}/crypt32.def)
|
||||
|
||||
if(MSVC)
|
||||
# error C4312: 'type cast': conversion from 'unsigned int' to 'void *' of greater size
|
||||
remove_target_compile_option(crypt32 "/we4312")
|
||||
# Disable warning C4090: 'function': different 'const' qualifiers
|
||||
# Disable warning C4312: 'type cast': conversion from 'unsigned int' to 'void *' of greater size
|
||||
target_compile_options(crypt32 PRIVATE /wd4090 /wd4312)
|
||||
endif()
|
||||
|
||||
set_module_type(crypt32 win32dll)
|
||||
|
|
|
@ -81,7 +81,8 @@ else()
|
|||
add_cd_file(TARGET dbghelp DESTINATION reactos/system32 FOR all)
|
||||
|
||||
if(MSVC)
|
||||
# Disable warning C4146: unary minus operator applied to unsigned type, result still unsigned
|
||||
# Disable warning C4477 (printf format warnings)
|
||||
remove_target_compile_option(dbghelp "/we4477")
|
||||
target_compile_options(dbghelp PRIVATE /wd4146 /wd4477)
|
||||
endif()
|
||||
endif()
|
||||
|
|
|
@ -33,6 +33,12 @@ add_library(gdiplus MODULE
|
|||
gdiplus.rc
|
||||
${CMAKE_CURRENT_BINARY_DIR}/gdiplus.def)
|
||||
|
||||
if(MSVC)
|
||||
# Disable warning C4146: unary minus operator applied to unsigned type, result still unsigned
|
||||
# Disable warning C4305: '=': truncation from 'double' to 'REAL'
|
||||
target_compile_options(gdiplus PRIVATE /wd4146 /wd4305)
|
||||
endif()
|
||||
|
||||
set_module_type(gdiplus win32dll)
|
||||
target_link_libraries(gdiplus wine)
|
||||
add_delay_importlibs(gdiplus windowscodecs)
|
||||
|
|
|
@ -55,6 +55,12 @@ add_library(jscript MODULE
|
|||
rsrc.rc
|
||||
${CMAKE_CURRENT_BINARY_DIR}/jscript.def)
|
||||
|
||||
if(MSVC)
|
||||
# Disable warning C4146: unary minus operator applied to unsigned type, result still unsigned
|
||||
# Disable warning C4267: '=': conversion from 'size_t' to 'WCHAR', possible loss of data
|
||||
target_compile_options(jscript PRIVATE /wd4146 /wd4267)
|
||||
endif()
|
||||
|
||||
add_idl_headers(jscript_idlheader jscript_classes.idl)
|
||||
add_typelib(jsglobal.idl)
|
||||
add_dependencies(jscript jscript_idlheader stdole2)
|
||||
|
|
|
@ -93,6 +93,11 @@ list(APPEND SOURCE
|
|||
winnls/string/sortkey.c
|
||||
k32.h)
|
||||
|
||||
if(MSVC)
|
||||
# Disable warning C4146: unary minus operator applied to unsigned type, result still unsigned
|
||||
set_source_files_properties(wine/res.c PROPERTIES COMPILE_FLAGS /wd4146)
|
||||
endif()
|
||||
|
||||
if(ARCH STREQUAL "i386")
|
||||
list(APPEND ASM_SOURCE
|
||||
client/i386/fiber.S
|
||||
|
|
|
@ -13,6 +13,9 @@ target_link_libraries(mciseq wine)
|
|||
add_importlibs(mciseq winmm user32 msvcrt kernel32 ntdll)
|
||||
add_cd_file(TARGET mciseq DESTINATION reactos/system32 FOR all)
|
||||
|
||||
if(NOT MSVC)
|
||||
if(MSVC)
|
||||
# Disable warning C4305: '=': truncation from 'UINT' to 'WORD'
|
||||
target_compile_options(mciseq PRIVATE /wd4305)
|
||||
else()
|
||||
target_compile_options(mciseq PRIVATE "-Wno-overflow")
|
||||
endif()
|
||||
|
|
|
@ -16,6 +16,9 @@ target_link_libraries(mciwave wine)
|
|||
add_importlibs(mciwave user32 winmm msvcrt kernel32 ntdll)
|
||||
add_cd_file(TARGET mciwave DESTINATION reactos/system32 FOR all)
|
||||
|
||||
if(NOT MSVC)
|
||||
if(MSVC)
|
||||
# Disable warning C4305: '=': truncation from 'UINT' to 'WORD'
|
||||
target_compile_options(mciwave PRIVATE /wd4305)
|
||||
else()
|
||||
target_compile_options(mciwave PRIVATE "-Wno-overflow")
|
||||
endif()
|
||||
|
|
|
@ -64,11 +64,11 @@ add_library(msi MODULE
|
|||
${CMAKE_CURRENT_BINARY_DIR}/msi.def)
|
||||
|
||||
if(MSVC)
|
||||
# error C4133: 'function': incompatible types - from 'UINT *' to 'MSIINSTALLCONTEXT *'
|
||||
remove_target_compile_option(msi "/we4133")
|
||||
|
||||
# error C4312: 'type cast': conversion from 'unsigned int' to 'HANDLE' of greater size
|
||||
remove_target_compile_option(msi "/we4312")
|
||||
# Disable warning C4090: 'function': different 'const' qualifiers
|
||||
# Disable warning C4133: 'function': incompatible types - from 'UINT *' to 'MSIINSTALLCONTEXT *'
|
||||
# Disable warning C4146: unary minus operator applied to unsigned type, result still unsigned
|
||||
# Disable warning C4312: 'type cast': conversion from 'unsigned int' to 'HANDLE' of greater size
|
||||
target_compile_options(msi PRIVATE /wd4090 /wd4133 /wd4146 /wd4312)
|
||||
endif()
|
||||
|
||||
add_idl_headers(msi_idlheader msiserver.idl)
|
||||
|
|
|
@ -76,6 +76,9 @@ target_link_libraries(msxml3 libxml2 iconv-static uuid wine zlib)
|
|||
|
||||
if(MSVC)
|
||||
target_compile_options(msxml3 PRIVATE /FIwine/typeof.h /FImsvc.h)
|
||||
|
||||
# Disable warning C4090: 'function': different 'const' qualifiers
|
||||
target_compile_options(msxml3 PRIVATE /wd4090)
|
||||
endif()
|
||||
|
||||
add_importlibs(msxml3 urlmon ws2_32 shlwapi oleaut32 ole32 user32 msvcrt kernel32 ntdll)
|
||||
|
|
|
@ -58,3 +58,8 @@ add_delay_importlibs(netapi32 samlib secur32)
|
|||
add_importlibs(netapi32 iphlpapi ws2_32 advapi32 rpcrt4 msvcrt kernel32 ntdll)
|
||||
add_pch(netapi32 netapi32.h "${PCH_SKIP_SOURCE}")
|
||||
add_cd_file(TARGET netapi32 DESTINATION reactos/system32 FOR all)
|
||||
|
||||
if(MSVC)
|
||||
# Disable warning C4267: '=': conversion from 'size_t' to 'USHORT', possible loss of data
|
||||
target_compile_options(netapi32 PRIVATE /wd4267)
|
||||
endif()
|
||||
|
|
|
@ -81,6 +81,12 @@ add_library(ole32 MODULE
|
|||
${CMAKE_CURRENT_BINARY_DIR}/irot_c.c
|
||||
${CMAKE_CURRENT_BINARY_DIR}/ole32.def)
|
||||
|
||||
if(MSVC)
|
||||
# Disable warning C4090: '=': different 'const' qualifiers
|
||||
# Disable warning C4146: unary minus operator applied to unsigned type, result still unsigned
|
||||
target_compile_options(ole32 PRIVATE /wd4090 /wd4146)
|
||||
endif()
|
||||
|
||||
set_module_type(ole32 win32dll)
|
||||
target_link_libraries(ole32 wine uuid ${PSEH_LIB})
|
||||
add_delay_importlibs(ole32 oleaut32)
|
||||
|
|
|
@ -49,6 +49,12 @@ add_library(oleaut32 MODULE
|
|||
oleaut32.rc
|
||||
${CMAKE_CURRENT_BINARY_DIR}/oleaut32.def)
|
||||
|
||||
if(MSVC)
|
||||
# Disable warning C4146: unary minus operator applied to unsigned type, result still unsigned
|
||||
# Disable warning C4267: 'initializing': conversion from 'size_t' to 'BYTE', possible loss of data
|
||||
target_compile_options(oleaut32 PRIVATE /wd4146 /wd4267)
|
||||
endif()
|
||||
|
||||
add_idl_headers(oleaut32_idlheader oleaut32_oaidl.idl)
|
||||
add_dependencies(oleaut32 oleaut32_idlheader)
|
||||
set_module_type(oleaut32 win32dll)
|
||||
|
|
|
@ -58,6 +58,11 @@ add_library(rpcrt4 MODULE
|
|||
rpcrt4.rc
|
||||
${CMAKE_CURRENT_BINARY_DIR}/rpcrt4.def)
|
||||
|
||||
if(MSVC)
|
||||
# Disable warning C4267: '=': conversion from 'size_t' to 'short', possible loss of data
|
||||
target_compile_options(rpcrt4 PRIVATE /wd4267)
|
||||
endif()
|
||||
|
||||
set_module_type(rpcrt4 win32dll)
|
||||
target_link_libraries(rpcrt4 wine uuid ${PSEH_LIB})
|
||||
add_delay_importlibs(rpcrt4 iphlpapi wininet secur32 user32 oleaut32)
|
||||
|
|
|
@ -39,6 +39,11 @@ add_library(vbscript MODULE
|
|||
vbscript.rc
|
||||
${CMAKE_CURRENT_BINARY_DIR}/vbscript.def)
|
||||
|
||||
if(MSVC)
|
||||
# Disable warning C4267: '=': conversion from 'size_t' to 'WCHAR', possible loss of data
|
||||
target_compile_options(vbscript PRIVATE /wd4267)
|
||||
endif()
|
||||
|
||||
set_module_type(vbscript win32dll)
|
||||
target_link_libraries(vbscript uuid wine)
|
||||
add_importlibs(vbscript oleaut32 ole32 user32 msvcrt kernel32 ntdll)
|
||||
|
|
|
@ -71,8 +71,9 @@ add_library(windowscodecs MODULE
|
|||
${CMAKE_CURRENT_BINARY_DIR}/windowscodecs.def)
|
||||
|
||||
if(MSVC)
|
||||
# error C4133: 'function': incompatible types - from 'WICPixelFormatNumericRepresentation *' to 'DWORD *'
|
||||
remove_target_compile_option(windowscodecs "/we4133")
|
||||
# Disable warning C4133: 'function': incompatible types - from 'WICPixelFormatNumericRepresentation *' to 'DWORD *'
|
||||
# Disable warning C4146: unary minus operator applied to unsigned type, result still unsigned
|
||||
target_compile_options(windowscodecs PRIVATE /wd4133 /wd4146)
|
||||
|
||||
target_compile_options(windowscodecs PRIVATE /FItypeof.h)
|
||||
endif()
|
||||
|
|
|
@ -39,6 +39,11 @@ add_library(wininet MODULE
|
|||
rsrc.rc
|
||||
${CMAKE_CURRENT_BINARY_DIR}/wininet.def)
|
||||
|
||||
if(MSVC)
|
||||
# Disable warning C4090: 'function': different 'const' qualifiers
|
||||
target_compile_options(wininet PRIVATE /wd4090)
|
||||
endif()
|
||||
|
||||
set_module_type(wininet win32dll)
|
||||
target_link_libraries(wininet wine ${PSEH_LIB} oldnames)
|
||||
|
||||
|
|
|
@ -23,8 +23,9 @@ add_library(winmm MODULE
|
|||
|
||||
|
||||
if(MSVC)
|
||||
# error C4312: 'type cast': conversion from 'DWORD' to 'HTASK' of greater size
|
||||
remove_target_compile_option(winmm "/we4312")
|
||||
# Disable warning C4090: 'function': different 'const' qualifiers
|
||||
# Disable warning C4312: 'type cast': conversion from 'DWORD' to 'HTASK' of greater size
|
||||
target_compile_options(winmm PRIVATE /wd4090 /wd4312)
|
||||
endif()
|
||||
|
||||
set_module_type(winmm win32dll)
|
||||
|
|
|
@ -17,6 +17,11 @@ add_library(wintrust MODULE
|
|||
version.rc
|
||||
${CMAKE_CURRENT_BINARY_DIR}/wintrust.def)
|
||||
|
||||
if(MSVC)
|
||||
# Disable warning C4090: 'function': different 'const' qualifiers
|
||||
target_compile_options(wintrust PRIVATE /wd4090)
|
||||
endif()
|
||||
|
||||
set_module_type(wintrust win32dll)
|
||||
target_link_libraries(wintrust wine ${PSEH_LIB})
|
||||
# FIXME: imagehlp should be delay-imported. See CORE-6504
|
||||
|
|
|
@ -15,6 +15,11 @@ add_library(xmllite MODULE
|
|||
guid.c
|
||||
${CMAKE_CURRENT_BINARY_DIR}/xmllite.def)
|
||||
|
||||
if(MSVC)
|
||||
# Disable warning C4146: unary minus operator applied to unsigned type, result still unsigned
|
||||
target_compile_options(xmllite PRIVATE /wd4146)
|
||||
endif()
|
||||
|
||||
set_module_type(xmllite win32dll)
|
||||
target_link_libraries(xmllite uuid wine)
|
||||
add_importlibs(xmllite msvcrt kernel32 ntdll)
|
||||
|
|
|
@ -16,6 +16,11 @@ if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
|
|||
target_compile_options(fbtusb PRIVATE -Wno-unused-but-set-variable)
|
||||
endif()
|
||||
|
||||
if(MSVC)
|
||||
# Disable warning C4267: '=': conversion from 'size_t' to 'USHORT', possible loss of data
|
||||
target_compile_options(fbtusb PRIVATE /wd4267)
|
||||
endif()
|
||||
|
||||
set_module_type(fbtusb kernelmodedriver)
|
||||
add_importlibs(fbtusb ntoskrnl hal usbd)
|
||||
add_pch(fbtusb precomp.h SOURCE)
|
||||
|
|
|
@ -65,6 +65,11 @@ add_asm_files(btrfs_asm ${ASM_SOURCE})
|
|||
|
||||
add_library(btrfs MODULE ${SOURCE} ${btrfs_asm} btrfs.rc)
|
||||
|
||||
if(MSVC)
|
||||
# Disable warning C4267: 'function': conversion from 'size_t' to 'uint16_t', possible loss of data
|
||||
target_compile_options(btrfs PRIVATE /wd4267)
|
||||
endif()
|
||||
|
||||
add_definitions(-D__KERNEL__)
|
||||
set_module_type(btrfs kernelmodedriver)
|
||||
target_link_libraries(btrfs rtlver zlib_solo chkstk wdmguid ${PSEH_LIB})
|
||||
|
|
|
@ -93,11 +93,11 @@ if(USE_CLANG_CL)
|
|||
endif()
|
||||
|
||||
if(MSVC)
|
||||
# Disable warnings: "unreferenced local variable", "initialized, but not used variable", "benign include"
|
||||
if (NOT CLANG)
|
||||
remove_target_compile_option(ext2fs "/we4101")
|
||||
remove_target_compile_option(ext2fs "/we4189")
|
||||
target_compile_options(ext2fs PRIVATE /wd4189 /wd4142 /wd4101)
|
||||
# Disable warning C4101: 'i': unreferenced local variable
|
||||
# Disable warning C4189: 'sbi': local variable is initialized but not referenced
|
||||
# Disable warning C4267: '=': conversion from 'size_t' to 'USHORT', possible loss of data
|
||||
target_compile_options(ext2fs PRIVATE /wd4101 /wd4189 /wd4267)
|
||||
endif()
|
||||
else()
|
||||
target_compile_options(ext2fs PRIVATE
|
||||
|
|
|
@ -28,6 +28,12 @@ if(USE_CLANG_CL OR (NOT MSVC))
|
|||
endif()
|
||||
endif()
|
||||
|
||||
if(MSVC)
|
||||
# Disable warning C4267: '=': conversion from 'size_t' to 'USHORT', possible loss of data
|
||||
# Disable warning C4838: conversion from 'int' to 'ULONG' requires a narrowing conversion
|
||||
target_compile_options(uniata PRIVATE /wd4267 /wd4838)
|
||||
endif()
|
||||
|
||||
if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
|
||||
target_compile_options(uniata PRIVATE -Wno-unused-but-set-variable)
|
||||
endif()
|
||||
|
|
|
@ -7,10 +7,6 @@ list(APPEND SOURCE
|
|||
testlist.c
|
||||
txtsrv.c)
|
||||
|
||||
if(MSVC)
|
||||
set_property(SOURCE editor.c APPEND_STRING PROPERTY COMPILE_FLAGS " /w14189")
|
||||
endif()
|
||||
|
||||
add_executable(riched20_winetest ${SOURCE})
|
||||
set_module_type(riched20_winetest win32cui)
|
||||
add_importlibs(riched20_winetest ole32 oleaut32 user32 gdi32 msvcrt kernel32)
|
||||
|
|
|
@ -14,3 +14,8 @@ list(APPEND SOURCE
|
|||
add_library(ext2lib ${SOURCE})
|
||||
add_pch(ext2lib Mke2fs.h SOURCE)
|
||||
add_dependencies(ext2lib psdk)
|
||||
|
||||
if(MSVC)
|
||||
# Disable warning C4267: '=': conversion from 'size_t' to '__u8', possible loss of data
|
||||
target_compile_options(ext2lib PRIVATE /wd4267)
|
||||
endif()
|
||||
|
|
Loading…
Reference in a new issue