From 891d0a123a4d9d552e1e3e286125d2638d2b9af0 Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool <compnerd@compnerd.org> Date: Thu, 28 Dec 2023 09:56:22 -0800 Subject: [PATCH] squelch C4232 warnings on MSVC builds C4232 appertains to the identity of dllimported functions [1]. The address of dllimport'ed functions are not guaranteed to maintain identity as the address will be the address of the IAT thunk, which is module specific. Two modules which bind to the same implementation may have different addresses. However, since the use of this is for `free`, it should be relatively safe as we do not expect to perform pointer identity comparisons. [1] https://learn.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-4-c4232?view=msvc-170 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2f05d8220..57aea954c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -50,7 +50,7 @@ add_compile_options($<$<CONFIG:Debug>:-DCMARK_DEBUG_NODES>) # so that CMark may be used in projects with non-C languages. function(cmark_add_compile_options target) if(MSVC) - target_compile_options(${target} PRIVATE /W4 /wd4706 /we4244 /we4267) + target_compile_options(${target} PRIVATE /W4 /wd4706 /wd4232 /we4244 /we4267) target_compile_definitions(${target} PRIVATE _CRT_SECURE_NO_WARNINGS) else() target_compile_options(${target} PRIVATE