Skip to content

Commit

Permalink
squelch C4232 warnings on MSVC builds
Browse files Browse the repository at this point in the history
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
  • Loading branch information
compnerd committed Jan 5, 2024
1 parent abff3b6 commit 891d0a1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 891d0a1

Please sign in to comment.