build: suppress -Wfree-nonheap-object false positives in lua_cjson #37250

Problem:
Building with GCC emits -Wfree-nonheap-object warnings in lua_cjson code
when calling strbuf_free(), despite the free being conditionally valid.
This is an unresolved GCC issue: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98753

Solution:
Supress warnings with the -Wno-free-nonheap-object flag for now.
This commit is contained in:
skewb1k
2026-03-18 09:27:19 +00:00
committed by GitHub
parent c3308fa5fe
commit 20225fc330

View File

@@ -134,6 +134,8 @@ elseif(CMAKE_C_COMPILER_ID STREQUAL "GNU")
$<$<CONFIG:Release>:-Wno-unused-result>
$<$<CONFIG:RelWithDebInfo>:-Wno-unused-result>
$<$<CONFIG:MinSizeRel>:-Wno-unused-result>)
target_link_options(nvim_bin PRIVATE -Wno-free-nonheap-object) # see #37250
elseif(CMAKE_C_COMPILER_ID MATCHES "Clang")
# On FreeBSD 64 math.h uses unguarded C11 extension, which taints clang
# 3.4.1 used there.