Add C4267 suppression for remaining tools and 3rd party libraries

Co-authored-by: tkreuzer <313067+tkreuzer@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2025-08-21 20:17:19 +00:00
parent 8b932aee6c
commit 10d0022f29
15 changed files with 84 additions and 0 deletions

View File

@@ -28,5 +28,10 @@ if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
target_compile_options(adns PRIVATE -Wno-unused-but-set-variable)
endif()
if(MSVC AND ARCH STREQUAL "amd64")
# Disable warning "conversion from 'size_t' to 'int', possible loss of data"
target_compile_options(adns PRIVATE "/wd4267")
endif()
add_dependencies(adns psdk)
add_pch(adns src/internal.h SOURCE)

View File

@@ -22,5 +22,10 @@ if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
target_compile_options(cardlib PRIVATE -Wno-unused-but-set-variable)
endif()
if(MSVC AND ARCH STREQUAL "amd64")
# Disable warning "conversion from 'size_t' to 'int', possible loss of data"
target_compile_options(cardlib PRIVATE "/wd4267")
endif()
add_dependencies(cardlib psdk)
add_pch(cardlib cardlib.h SOURCE)

View File

@@ -51,6 +51,8 @@ add_library(freetype ${SOURCE})
if(CMAKE_C_COMPILER_ID STREQUAL "MSVC" AND ARCH STREQUAL "amd64")
# error C4312: 'type cast': conversion from 'unsigned long' to 'void *' of greater size
remove_target_compile_option(freetype "/we4312")
# Disable warning "conversion from 'size_t' to 'int', possible loss of data"
target_compile_options(freetype PRIVATE "/wd4267")
endif()
if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "Clang")

View File

@@ -46,6 +46,11 @@ add_library(libmpg123
${SOURCE}
${PCH_SKIP_SOURCE})
if(MSVC AND ARCH STREQUAL "amd64")
# Disable warning "conversion from 'size_t' to 'int', possible loss of data"
target_compile_options(libmpg123 PRIVATE "/wd4267")
endif()
target_link_libraries(libmpg123 oldnames)
add_dependencies(libmpg123 psdk)
add_pch(libmpg123 precomp.h "${PCH_SKIP_SOURCE}")

View File

@@ -17,12 +17,27 @@ add_dependencies(wine psdk)
target_compile_definitions(wine PRIVATE __WINESRC__ _WINE)
target_include_directories(wine BEFORE PRIVATE ${REACTOS_SOURCE_DIR}/sdk/include/wine)
if(MSVC AND ARCH STREQUAL "amd64")
# Disable warning "conversion from 'size_t' to 'int', possible loss of data"
target_compile_options(wine PRIVATE "/wd4267")
endif()
add_library(wineldr loader.c)
add_dependencies(wineldr xdk)
target_compile_definitions(wineldr PRIVATE __WINESRC__)
target_include_directories(wineldr BEFORE PRIVATE ${REACTOS_SOURCE_DIR}/sdk/include/wine)
if(MSVC AND ARCH STREQUAL "amd64")
# Disable warning "conversion from 'size_t' to 'int', possible loss of data"
target_compile_options(wineldr PRIVATE "/wd4267")
endif()
add_library(wine_dll_register dll_register.c ${SOURCE})
add_dependencies(wine_dll_register psdk)
target_compile_definitions(wine_dll_register PRIVATE __WINESRC__ _WINE)
target_include_directories(wine_dll_register BEFORE PRIVATE ${REACTOS_SOURCE_DIR}/sdk/include/wine)
if(MSVC AND ARCH STREQUAL "amd64")
# Disable warning "conversion from 'size_t' to 'int', possible loss of data"
target_compile_options(wine_dll_register PRIVATE "/wd4267")
endif()

View File

@@ -69,6 +69,11 @@ if(CMAKE_C_COMPILER_ID STREQUAL "MSVC")
target_compile_options(libxml2 PRIVATE "/wd4101")
# Local variable initialized but not referenced
remove_target_compile_option(libxml2 "/we4189")
if(ARCH STREQUAL "amd64")
# Disable warning "conversion from 'size_t' to 'int', possible loss of data"
target_compile_options(libxml2 PRIVATE "/wd4267")
endif()
else()
target_compile_options(libxml2 PRIVATE "-w")
endif()

View File

@@ -21,5 +21,11 @@ list(APPEND SOURCE
precomp.h)
add_library(strmbase ${SOURCE})
if(MSVC AND ARCH STREQUAL "amd64")
# Disable warning "conversion from 'size_t' to 'int', possible loss of data"
target_compile_options(strmbase PRIVATE "/wd4267")
endif()
add_pch(strmbase precomp.h SOURCE)
add_dependencies(strmbase psdk dxsdk)

View File

@@ -35,6 +35,11 @@ if(CMAKE_C_COMPILER_ID STREQUAL "Clang")
add_compile_options(-Wno-deprecated-non-prototype)
endif()
if(MSVC AND ARCH STREQUAL "amd64")
# Disable warning "conversion from 'size_t' to 'int', possible loss of data"
add_compile_options("/wd4267")
endif()
if(CMAKE_CROSSCOMPILING)
add_library(zlib ${SOURCE} ${SOLO_SOURCE})
target_link_libraries(zlib oldnames)

View File

@@ -6,3 +6,8 @@ list(APPEND SOURCE
add_host_tool(asmpp ${SOURCE})
target_link_libraries(asmpp PRIVATE host_includes)
set_property(TARGET asmpp PROPERTY CXX_STANDARD 11)
if(MSVC AND ARCH STREQUAL "amd64")
# Disable warning "conversion from 'size_t' to 'int', possible loss of data"
target_compile_options(asmpp PRIVATE "/wd4267")
endif()

View File

@@ -18,3 +18,8 @@ list(APPEND SOURCE
add_host_tool(cabman ${SOURCE})
target_link_libraries(cabman PRIVATE host_includes zlibhost)
set_property(TARGET cabman PROPERTY CXX_STANDARD 11)
if(MSVC AND ARCH STREQUAL "amd64")
# Disable warning "conversion from 'size_t' to 'int', possible loss of data"
target_compile_options(cabman PRIVATE "/wd4267")
endif()

View File

@@ -5,3 +5,8 @@ add_host_tool(fatten
fatfs/ff.c
fatfs/option/ccsbcs.c)
target_link_libraries(fatten PRIVATE host_includes)
if(MSVC AND ARCH STREQUAL "amd64")
# Disable warning "conversion from 'size_t' to 'int', possible loss of data"
target_compile_options(fatten PRIVATE "/wd4267")
endif()

View File

@@ -7,3 +7,8 @@ add_host_tool(isohybrid
reactos_support_code.c
../port/getopt.c
../port/getopt1.c)
if(MSVC AND ARCH STREQUAL "amd64")
# Disable warning "conversion from 'size_t' to 'int', possible loss of data"
target_compile_options(isohybrid PRIVATE "/wd4267")
endif()

View File

@@ -1,3 +1,8 @@
add_host_tool(kbdtool data.c main.c output.c parser.c)
target_link_libraries(kbdtool PRIVATE host_includes)
if(MSVC AND ARCH STREQUAL "amd64")
# Disable warning "conversion from 'size_t' to 'int', possible loss of data"
target_compile_options(kbdtool PRIVATE "/wd4267")
endif()

View File

@@ -6,5 +6,11 @@ target_link_libraries(rsym_common PRIVATE host_includes)
add_host_tool(rsym rsym.c)
target_link_libraries(rsym PRIVATE host_includes rsym_common dbghelphost unicode)
if(MSVC AND ARCH STREQUAL "amd64")
# Disable warning "conversion from 'size_t' to 'int', possible loss of data"
target_compile_options(rsym PRIVATE "/wd4267")
endif()
add_host_tool(raddr2line raddr2line.c)
target_link_libraries(raddr2line PRIVATE host_includes rsym_common)

View File

@@ -2,3 +2,8 @@
list(APPEND SOURCE main.cpp)
add_host_tool(txt2nls ${SOURCE})
if(MSVC AND ARCH STREQUAL "amd64")
# Disable warning "conversion from 'size_t' to 'int', possible loss of data"
target_compile_options(txt2nls PRIVATE "/wd4267")
endif()