[pull] master from open-source-parsers:master#65
Merged
pull[bot] merged 8 commits intopthis:masterfrom Mar 16, 2026
Merged
Conversation
) * Fix uninitialized CMake variable in version.in CMake's project() command sets jsoncpp_VERSION (lowercase prefix), not JSONCPP_VERSION. The wrong variable caused the generated version file to be empty. Fixes #1656 Co-Authored-By: Claude Sonnet 4.6 <[email protected]> * Fix CMake deprecation warning for compatibility with CMake < 3.10 Bump JSONCPP_OLDEST_VALIDATED_POLICIES_VERSION from 3.8.0 to 3.10.0 to silence the CMake 3.31 deprecation warning. Fixes #1598 --------- Co-authored-by: Claude Sonnet 4.6 <[email protected]>
Replaced directory-wide add_compile_definitions/add_definitions with target_compile_definitions PRIVATE on the shared lib target, so JSON_DLL_BUILD is not incorrectly applied to static and object libs. Fixes #1634
IStringStream inherits the global locale, so parsing doubles with operator>> fails when the locale uses ',' as the decimal separator (e.g. de_DE). Imbue the stream with std::locale::classic() in both Reader::decodeDouble and OurReader::decodeDouble. The writer already handles this correctly via fixNumericLocale(). Fixes #1565
RFC 8259 requires that control characters (U+0000-U+001F) be escaped when they appear inside strings. jsoncpp previously accepted them silently. Add a check in Reader::decodeString and OurReader::decodeString to return an error when an unescaped control character is encountered. Fixes #1546
The library was forced to build with CMAKE_CXX_STANDARD 11, so JSONCPP_HAS_STRING_VIEW was never defined at compile time. Consumers building with C++17 would see the string_view APIs in the header but fail to link them. Fix: - Remove the global CMAKE_CXX_STANDARD 11 override; the existing target_compile_features(cxx_std_11) already enforces the minimum. - Detect string_view support at configure time with check_cxx_source_compiles and export JSONCPP_HAS_STRING_VIEW as a PUBLIC compile definition on all library targets, so consumers always see the same value the library was built with. - Guard the __cplusplus fallback in value.h so it does not override the CMake-set define. Fixes #1595
The istream overload stored the document in a local String then passed raw pointers into it to parse(const char*, const char*), which kept those pointers in begin_/end_. After parse() returned the local String was destroyed, leaving begin_/end_ dangling. Any subsequent call to getFormattedErrorMessages() would then read freed memory. Fix by reading the stream into the member document_ instead, matching the behavior of parse(const std::string&). Also document the lifetime requirement on parse(const char*, const char*): the caller's buffer must outlive the Reader if error-reporting methods are used after parsing. Fixes #1623
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )