Skip to content

[pull] master from open-source-parsers:master#65

Merged
pull[bot] merged 8 commits intopthis:masterfrom
open-source-parsers:master
Mar 16, 2026
Merged

[pull] master from open-source-parsers:master#65
pull[bot] merged 8 commits intopthis:masterfrom
open-source-parsers:master

Conversation

@pull
Copy link
Copy Markdown

@pull pull bot commented Mar 16, 2026

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 : )

baylesj and others added 8 commits March 15, 2026 17:54
)

* 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
* Fix MSAN issue in #1626

This patch fixes an MSAN issue by changing CZString
initialization.

* add test

* expand tests

* fix build

* Export CZString with JSON_API to fix Windows DLL linker errors
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
* Revert "Fix number parsing failing under non-C locales (#1662)"

This reverts commit 8661f9e.

* readd json reader changes
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
@pull pull bot locked and limited conversation to collaborators Mar 16, 2026
@pull pull bot added the ⤵️ pull label Mar 16, 2026
@pull pull bot merged commit ce757be into pthis:master Mar 16, 2026
10 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant