diff options
| author | Markus Volk <f_l_k@t-online.de> | 2026-05-30 09:08:23 +0200 |
|---|---|---|
| committer | Khem Raj <khem.raj@oss.qualcomm.com> | 2026-06-07 18:21:32 -0700 |
| commit | fe8e466c68f21669356bd895c0b7d1545689af93 (patch) | |
| tree | 2d7013b707a5e38ceaf8723f6b0a0a18324b4cb2 | |
| parent | bd2d58836d9a34b628d85caf677d8c183fb8c3c6 (diff) | |
| download | meta-openembedded-fe8e466c68f21669356bd895c0b7d1545689af93.tar.gz | |
jsoncpp: add a backport patch to fix build with gcc16
Partially backport https://github.com/open-source-parsers/jsoncpp/commit/71d46ca38e90dc902e8178ba484af4f27fa11947.patch
This fixes build with gcc 16
Upstream-Status: Backport [https://github.com/open-source-parsers/jsoncpp/commit/71d46ca38e90dc902e8178ba484af4f27fa11947]
Signed-off-by: Markus Volk <f_l_k@t-online.de>
Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
| -rw-r--r-- | meta-oe/recipes-devtools/jsoncpp/jsoncpp/71d46ca38e90dc902e8178ba484af4f27fa11947.patch | 63 | ||||
| -rw-r--r-- | meta-oe/recipes-devtools/jsoncpp/jsoncpp_1.9.7.bb | 1 |
2 files changed, 64 insertions, 0 deletions
diff --git a/meta-oe/recipes-devtools/jsoncpp/jsoncpp/71d46ca38e90dc902e8178ba484af4f27fa11947.patch b/meta-oe/recipes-devtools/jsoncpp/jsoncpp/71d46ca38e90dc902e8178ba484af4f27fa11947.patch new file mode 100644 index 0000000000..d649c2ed4c --- /dev/null +++ b/meta-oe/recipes-devtools/jsoncpp/jsoncpp/71d46ca38e90dc902e8178ba484af4f27fa11947.patch | |||
| @@ -0,0 +1,63 @@ | |||
| 1 | From 71d46ca38e90dc902e8178ba484af4f27fa11947 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Jordan Bayles <bayles.jordan@gmail.com> | ||
| 3 | Date: Thu, 14 May 2026 15:57:53 -0700 | ||
| 4 | Subject: [PATCH] fix: GCC 16 / C++20 build failure with u8 string literals | ||
| 5 | (#1685) | ||
| 6 | |||
| 7 | * fix: GCC 16 / C++20 build failure with u8 string literals (#1684) | ||
| 8 | |||
| 9 | In C++20, the `u8""` string literal prefix was changed to evaluate to `const char8_t[]` instead of `const char[]`. This caused compilation errors when these literals were implicitly converted to `std::string` or passed to functions expecting `const char*`. | ||
| 10 | |||
| 11 | This commit adds `reinterpret_cast<const char*>` around the `u8` string literals in the test suite to resolve the build errors while maintaining the intended UTF-8 semantics. | ||
| 12 | |||
| 13 | Additionally, this adds C++20 to the GitHub Actions CMake test matrix to ensure we don't regress on newer standards. | ||
| 14 | |||
| 15 | Fixes #1684 | ||
| 16 | |||
| 17 | * style: run clang-format | ||
| 18 | |||
| 19 | Upstream-Status: Backport [https://github.com/open-source-parsers/jsoncpp/commit/71d46ca38e90dc902e8178ba484af4f27fa11947] | ||
| 20 | |||
| 21 | Signed-off-by: Markus Volk <f_l_k@t-online.de> | ||
| 22 | --- | ||
| 23 | .github/workflows/cmake.yml | 2 +- | ||
| 24 | src/test_lib_json/main.cpp | 12 +++++++----- | ||
| 25 | 2 files changed, 8 insertions(+), 6 deletions(-) | ||
| 26 | |||
| 27 | diff --git a/src/test_lib_json/main.cpp b/src/test_lib_json/main.cpp | ||
| 28 | index 501aba10e..08731f66a 100644 | ||
| 29 | --- a/src/test_lib_json/main.cpp | ||
| 30 | +++ b/src/test_lib_json/main.cpp | ||
| 31 | @@ -1993,7 +1993,8 @@ JSONTEST_FIXTURE_LOCAL(ValueTest, StaticString) { | ||
| 32 | |||
| 33 | JSONTEST_FIXTURE_LOCAL(ValueTest, WideString) { | ||
| 34 | // https://github.com/open-source-parsers/jsoncpp/issues/756 | ||
| 35 | - const std::string uni = u8"\u5f0f\uff0c\u8fdb"; // "式,进" | ||
| 36 | + const std::string uni = | ||
| 37 | + reinterpret_cast<const char*>(u8"\u5f0f\uff0c\u8fdb"); // "式,进" | ||
| 38 | std::string styled; | ||
| 39 | { | ||
| 40 | Json::Value v; | ||
| 41 | @@ -3109,9 +3110,9 @@ JSONTEST_FIXTURE_LOCAL(ReaderTest, strictModeParseNumber) { | ||
| 42 | } | ||
| 43 | |||
| 44 | JSONTEST_FIXTURE_LOCAL(ReaderTest, parseChineseWithOneError) { | ||
| 45 | - checkParse(R"({ "pr)" | ||
| 46 | - u8"\u4f50\u85e4" // 佐藤 | ||
| 47 | - R"(erty" :: "value" })", | ||
| 48 | + checkParse(reinterpret_cast<const char*>(R"({ "pr)" | ||
| 49 | + u8"\u4f50\u85e4" // 佐藤 | ||
| 50 | + R"(erty" :: "value" })"), | ||
| 51 | {{18, 19, "Syntax error: value, object or array expected."}}, | ||
| 52 | "* Line 1, Column 19\n Syntax error: value, object or array " | ||
| 53 | "expected.\n"); | ||
| 54 | @@ -3223,7 +3224,8 @@ JSONTEST_FIXTURE_LOCAL(CharReaderTest, parseString) { | ||
| 55 | bool ok = reader->parse(doc, doc + std::strlen(doc), &root, &errs); | ||
| 56 | JSONTEST_ASSERT(ok); | ||
| 57 | JSONTEST_ASSERT(errs.empty()); | ||
| 58 | - JSONTEST_ASSERT_EQUAL(u8"\u8A2a", root[0].asString()); // "訪" | ||
| 59 | + JSONTEST_ASSERT_EQUAL(reinterpret_cast<const char*>(u8"\u8A2a"), | ||
| 60 | + root[0].asString()); // "訪" | ||
| 61 | } | ||
| 62 | { | ||
| 63 | char const doc[] = R"([ "\uD801" ])"; | ||
diff --git a/meta-oe/recipes-devtools/jsoncpp/jsoncpp_1.9.7.bb b/meta-oe/recipes-devtools/jsoncpp/jsoncpp_1.9.7.bb index 354f4e9115..bf91f8eff4 100644 --- a/meta-oe/recipes-devtools/jsoncpp/jsoncpp_1.9.7.bb +++ b/meta-oe/recipes-devtools/jsoncpp/jsoncpp_1.9.7.bb | |||
| @@ -16,6 +16,7 @@ PE = "1" | |||
| 16 | SRCREV = "3455302847cf1e4671f1d8f5fa953fd46a7b1404" | 16 | SRCREV = "3455302847cf1e4671f1d8f5fa953fd46a7b1404" |
| 17 | SRC_URI = "git://github.com/open-source-parsers/jsoncpp;branch=master;protocol=https;tag=${PV} \ | 17 | SRC_URI = "git://github.com/open-source-parsers/jsoncpp;branch=master;protocol=https;tag=${PV} \ |
| 18 | file://0001-Fix-C-11-ABI-breakage-when-compiled-with-C-17-1668-1.patch \ | 18 | file://0001-Fix-C-11-ABI-breakage-when-compiled-with-C-17-1668-1.patch \ |
| 19 | file://71d46ca38e90dc902e8178ba484af4f27fa11947.patch \ | ||
| 19 | file://run-ptest \ | 20 | file://run-ptest \ |
| 20 | " | 21 | " |
| 21 | 22 | ||
