rapidjson icon indicating copy to clipboard operation
rapidjson copied to clipboard

Fix -Werror=free-nonheap-object warning as error and add support for RVCT 4.1 ARM compiler

Open djbn65 opened this issue 1 year ago • 4 comments

When building the perftest, schematest.cpp was yielding an error in relation to freeing a stack object. This change fixes that by explicitly passing in nullptr to CrtAllocator::Free if we don't own the memory.

Fixes: #2267

djbn65 avatar Mar 21 '24 19:03 djbn65

std::free(nullptr)

is also safe and does not invoke undefined behavior as per the standard.

djbn65 avatar Mar 22 '24 11:03 djbn65

@miloyip, @tencent-adm, this patch should be ready to go

djbn65 avatar Mar 22 '24 11:03 djbn65

Added another commit to the PR to support the RVCT 4.1 ARM compiler with some preprocessor checks

djbn65 avatar May 29 '24 14:05 djbn65

@miloyip, @tencent-adm, this is ready to go

djbn65 avatar May 29 '24 19:05 djbn65