From 10d0022f29cd4d38d998a1ae9ac6a2c7e7a88d92 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 21 Aug 2025 20:17:19 +0000 Subject: [PATCH] Add C4267 suppression for remaining tools and 3rd party libraries Co-authored-by: tkreuzer <313067+tkreuzer@users.noreply.github.com> --- sdk/lib/3rdparty/adns/CMakeLists.txt | 5 +++++ sdk/lib/3rdparty/cardlib/CMakeLists.txt | 5 +++++ sdk/lib/3rdparty/freetype/CMakeLists.txt | 2 ++ sdk/lib/3rdparty/libmpg123/CMakeLists.txt | 5 +++++ sdk/lib/3rdparty/libwine/CMakeLists.txt | 15 +++++++++++++++ sdk/lib/3rdparty/libxml2/CMakeLists.txt | 5 +++++ sdk/lib/3rdparty/strmbase/CMakeLists.txt | 6 ++++++ sdk/lib/3rdparty/zlib/CMakeLists.txt | 5 +++++ sdk/tools/asmpp/CMakeLists.txt | 5 +++++ sdk/tools/cabman/CMakeLists.txt | 5 +++++ sdk/tools/fatten/CMakeLists.txt | 5 +++++ sdk/tools/isohybrid/CMakeLists.txt | 5 +++++ sdk/tools/kbdtool/CMakeLists.txt | 5 +++++ sdk/tools/rsym/CMakeLists.txt | 6 ++++++ sdk/tools/txt2nls/CMakeLists.txt | 5 +++++ 15 files changed, 84 insertions(+) diff --git a/sdk/lib/3rdparty/adns/CMakeLists.txt b/sdk/lib/3rdparty/adns/CMakeLists.txt index 34b0deeafd8..3b9f8609ae8 100644 --- a/sdk/lib/3rdparty/adns/CMakeLists.txt +++ b/sdk/lib/3rdparty/adns/CMakeLists.txt @@ -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) diff --git a/sdk/lib/3rdparty/cardlib/CMakeLists.txt b/sdk/lib/3rdparty/cardlib/CMakeLists.txt index b35c25d8046..04054c8f484 100644 --- a/sdk/lib/3rdparty/cardlib/CMakeLists.txt +++ b/sdk/lib/3rdparty/cardlib/CMakeLists.txt @@ -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) diff --git a/sdk/lib/3rdparty/freetype/CMakeLists.txt b/sdk/lib/3rdparty/freetype/CMakeLists.txt index 5f9fa7e7092..59addbefeba 100644 --- a/sdk/lib/3rdparty/freetype/CMakeLists.txt +++ b/sdk/lib/3rdparty/freetype/CMakeLists.txt @@ -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") diff --git a/sdk/lib/3rdparty/libmpg123/CMakeLists.txt b/sdk/lib/3rdparty/libmpg123/CMakeLists.txt index 876e78b6d28..d95d0186f2e 100644 --- a/sdk/lib/3rdparty/libmpg123/CMakeLists.txt +++ b/sdk/lib/3rdparty/libmpg123/CMakeLists.txt @@ -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}") diff --git a/sdk/lib/3rdparty/libwine/CMakeLists.txt b/sdk/lib/3rdparty/libwine/CMakeLists.txt index 014ce9d242c..c289e74da7c 100644 --- a/sdk/lib/3rdparty/libwine/CMakeLists.txt +++ b/sdk/lib/3rdparty/libwine/CMakeLists.txt @@ -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() diff --git a/sdk/lib/3rdparty/libxml2/CMakeLists.txt b/sdk/lib/3rdparty/libxml2/CMakeLists.txt index ba32c6a732a..56ad07490c4 100644 --- a/sdk/lib/3rdparty/libxml2/CMakeLists.txt +++ b/sdk/lib/3rdparty/libxml2/CMakeLists.txt @@ -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() diff --git a/sdk/lib/3rdparty/strmbase/CMakeLists.txt b/sdk/lib/3rdparty/strmbase/CMakeLists.txt index 1c447fd378b..49fd6cc553e 100644 --- a/sdk/lib/3rdparty/strmbase/CMakeLists.txt +++ b/sdk/lib/3rdparty/strmbase/CMakeLists.txt @@ -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) diff --git a/sdk/lib/3rdparty/zlib/CMakeLists.txt b/sdk/lib/3rdparty/zlib/CMakeLists.txt index 2630baf0870..5a28a1b4d13 100644 --- a/sdk/lib/3rdparty/zlib/CMakeLists.txt +++ b/sdk/lib/3rdparty/zlib/CMakeLists.txt @@ -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) diff --git a/sdk/tools/asmpp/CMakeLists.txt b/sdk/tools/asmpp/CMakeLists.txt index d65a7c4ca28..8a273830b12 100644 --- a/sdk/tools/asmpp/CMakeLists.txt +++ b/sdk/tools/asmpp/CMakeLists.txt @@ -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() diff --git a/sdk/tools/cabman/CMakeLists.txt b/sdk/tools/cabman/CMakeLists.txt index 807c2990451..3682f4010cf 100644 --- a/sdk/tools/cabman/CMakeLists.txt +++ b/sdk/tools/cabman/CMakeLists.txt @@ -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() diff --git a/sdk/tools/fatten/CMakeLists.txt b/sdk/tools/fatten/CMakeLists.txt index 902db728f8b..2108068ffeb 100644 --- a/sdk/tools/fatten/CMakeLists.txt +++ b/sdk/tools/fatten/CMakeLists.txt @@ -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() diff --git a/sdk/tools/isohybrid/CMakeLists.txt b/sdk/tools/isohybrid/CMakeLists.txt index 06a09bc2295..e73590f7744 100644 --- a/sdk/tools/isohybrid/CMakeLists.txt +++ b/sdk/tools/isohybrid/CMakeLists.txt @@ -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() diff --git a/sdk/tools/kbdtool/CMakeLists.txt b/sdk/tools/kbdtool/CMakeLists.txt index c525926ab52..64fb9ccedd9 100644 --- a/sdk/tools/kbdtool/CMakeLists.txt +++ b/sdk/tools/kbdtool/CMakeLists.txt @@ -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() diff --git a/sdk/tools/rsym/CMakeLists.txt b/sdk/tools/rsym/CMakeLists.txt index 6f64c9de446..2ba78d44084 100644 --- a/sdk/tools/rsym/CMakeLists.txt +++ b/sdk/tools/rsym/CMakeLists.txt @@ -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) diff --git a/sdk/tools/txt2nls/CMakeLists.txt b/sdk/tools/txt2nls/CMakeLists.txt index 8669da89d75..de485ad5c51 100644 --- a/sdk/tools/txt2nls/CMakeLists.txt +++ b/sdk/tools/txt2nls/CMakeLists.txt @@ -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()