Skip to content

Commit 0320f3d

Browse files
Fixed clang warning in gzwrite.c in 32-bit build
1 parent c837cbb commit 0320f3d

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

ThirdParty/zlib-1.2.8/CMakeLists.txt

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,14 @@ if(PLATFORM_LINUX OR PLATFORM_ANDROID OR PLATFORM_MACOS OR PLATFORM_IOS)
4848
target_compile_definitions(ZLib PRIVATE HAVE_UNISTD_H)
4949
endif()
5050

51-
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR
52-
CMAKE_CXX_COMPILER_ID MATCHES "GNU")
53-
# For inflate.c, disable the following
54-
# warning: shifting a negative signed value is undefined [-Wshift-negative-value]
51+
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
52+
# Disable the following warning:
53+
# shifting a negative signed value is undefined [-Wshift-negative-value]
5554
set_source_files_properties(inflate.c PROPERTIES COMPILE_FLAGS -Wno-shift-negative-value)
55+
56+
# Disable the following warning:
57+
# implicit conversion loses integer precision: 'ssize_t' (aka 'long') to 'int'
58+
set_source_files_properties(gzwrite.c gzread.c PROPERTIES COMPILE_FLAGS -Wno-shorten-64-to-32)
5659
endif()
5760

5861

0 commit comments

Comments
 (0)