10BC0 cmake: disable warnings for operands with different enum types · libgit2/libgit2@5d78d63 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5d78d63

Browse files
committed
cmake: disable warnings for operands with different enum types
With a recent upgrade to a newer version of MSVC we now get a bunch of warnings when two operands use different enum types. While sensible in theory, in practice we have a couple of non-public enums that extend public enums, like for example with `GIT_SUBMODULE_STATUS`. Let's for now disable this warning to unblock our builds. The alternative would be to add casts all over the place, but that feels rather cumbersome.
1 parent 5ab90d3 commit 5d78d63

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

cmake/DefaultCFlags.cmake

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ if(MSVC)
1313
# /Gd - explicitly set cdecl calling convention
1414
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Gd")
1515

16+
# Remove warnings about operands that use different enum types.
17+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd5287")
18+
1619
if(NOT (MSVC_VERSION LESS 1900))
1720
# /guard:cf - Enable Control Flow Guard
1821
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /guard:cf")

0 commit comments

Comments
 (0)
0