Tencent / rapidjson

A fast JSON parser/generator for C++ with both SAX/DOM style API
http://rapidjson.org/
Other
14.19k stars 3.53k forks source link

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

Open djbn65 opened 6 months ago

djbn65 commented 6 months ago

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 commented 6 months ago

std::free(nullptr)

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

djbn65 commented 6 months ago

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

djbn65 commented 4 months ago

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

djbn65 commented 4 months ago

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