Skip to content

Fix C++11 ABI breakage when compiled with C++17 (https://github.com/open-source-parsers/jsoncpp/issues/1668)#1675

Open
baylesj wants to merge 3 commits intomasterfrom
fix-cxx11-abi-break
Open

Fix C++11 ABI breakage when compiled with C++17 (https://github.com/open-source-parsers/jsoncpp/issues/1668)#1675
baylesj wants to merge 3 commits intomasterfrom
fix-cxx11-abi-break

Conversation

@baylesj
Copy link
Copy Markdown
Contributor

@baylesj baylesj commented Apr 8, 2026

When JSONCPP_HAS_STRING_VIEW is defined while JsonCpp is built, but not in a consuming library, the
const char* and const String& overloads for operator[], get,
removeMember, and isMember are defined in the header but do not have an implementation, breaking ABI compatibility for projects consuming the library with C++11.

This change unconditionally declares and defines the legacy overloads so they are always exported, restoring compatibility.

baylesj added 2 commits April 7, 2026 20:39
- Injects `FORCE_JAVASCRIPT_ACTIONS_TO_NODE24=true` in all workflows to
  opt-in to Node.js 24 and suppress the deprecation warnings from
  multiple GitHub Actions.
- Specifies `python-version: '3.x'` for `actions/setup-python@v5` in
  `meson.yml` to fix the missing input warning.
When JSONCPP_HAS_STRING_VIEW was defined, the library dropped the
`const char*` and `const String&` overloads for `operator[]`, `get`,
`removeMember`, and `isMember`, breaking ABI compatibility for projects
consuming the library with C++11.

This change unconditionally declares and defines the legacy overloads
so they are always exported, restoring compatibility.
@baylesj baylesj changed the title Fix cxx11 abi break Fix C++11 ABI breakage when compiled with C++17 (https://github.com/open-source-parsers/jsoncpp/issues/1668) Apr 8, 2026
@coveralls
Copy link
Copy Markdown

Coverage Report for CI Build 24118690154

Coverage remained the same at 90.093%

Details

  • Coverage remained the same as the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 2691
Covered Lines: 2574
Line Coverage: 95.65%
Relevant Branches: 2588
Covered Branches: 2182
Branch Coverage: 84.31%
Branches in Coverage %: Yes
Coverage Strength: 23739.33 hits per line

💛 - Coveralls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants