summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta-oe/recipes-dbs/leveldb/leveldb/0001-Use-static_cast-instead-of-ImplicitCast_-for-charact.patch49
-rw-r--r--meta-oe/recipes-dbs/leveldb/leveldb_1.23.bb1
2 files changed, 50 insertions, 0 deletions
diff --git a/meta-oe/recipes-dbs/leveldb/leveldb/0001-Use-static_cast-instead-of-ImplicitCast_-for-charact.patch b/meta-oe/recipes-dbs/leveldb/leveldb/0001-Use-static_cast-instead-of-ImplicitCast_-for-charact.patch
new file mode 100644
index 0000000000..7a06630918
--- /dev/null
+++ b/meta-oe/recipes-dbs/leveldb/leveldb/0001-Use-static_cast-instead-of-ImplicitCast_-for-charact.patch
@@ -0,0 +1,49 @@
1From fa8438ae6b70c57010177de47a9f13d7041a6328 Mon Sep 17 00:00:00 2001
2From: Abseil Team <absl-team@google.com>
3Date: Mon, 19 May 2025 09:01:54 -0700
4Subject: [PATCH] Use static_cast instead of ImplicitCast_ for character
5 conversions
6
7Clang has recently added "warnings when mixing different charN_t types" [1].
8The rationale is that "charN_t represent code units of different UTF encodings.
9Therefore the values of 2 different charN_t objects do not represent the same
10characters."
11
12Note that the warning here may be legitimate - from https://github.com/google/googletest/issues/4762:
13"[...] This is incorrect for values that do not represent valid codepoints."
14
15For the time being, silence the warning by being more explicit about the
16conversion being intentional by using static_cast.
17
18Link: https://github.com/llvm/llvm-project/pull/138708 [1]
19PiperOrigin-RevId: 760644157
20Change-Id: I2e6cc1871975455cecac8731b2f93fd5beeaf0e1
21
22Upstream-Status: Backport [https://github.com/google/googletest/commit/fa8438ae6b70c57010177de47a9f13d7041a6328]
23Signed-off-by: Khem Raj <raj.khem@gmail.com>
24---
25 third_party/googletest/googletest/include/gtest/gtest-printers.h | 8 ++++++--
26 1 file changed, 6 insertions(+), 2 deletions(-)
27
28Index: leveldb-1.23/third_party/googletest/googletest/include/gtest/gtest-printers.h
29===================================================================
30--- leveldb-1.23.orig/third_party/googletest/googletest/include/gtest/gtest-printers.h
31+++ leveldb-1.23/third_party/googletest/googletest/include/gtest/gtest-printers.h
32@@ -471,11 +471,15 @@ GTEST_API_ void PrintTo(wchar_t wc, ::st
33
34 GTEST_API_ void PrintTo(char32_t c, ::std::ostream* os);
35 inline void PrintTo(char16_t c, ::std::ostream* os) {
36- PrintTo(ImplicitCast_<char32_t>(c), os);
37+ // TODO(b/418738869): Incorrect for values not representing valid codepoints.
38+ // Also see https://github.com/google/googletest/issues/4762.
39+ PrintTo(static_cast<char32_t>(c), os);
40 }
41 #ifdef __cpp_char8_t
42 inline void PrintTo(char8_t c, ::std::ostream* os) {
43- PrintTo(ImplicitCast_<char32_t>(c), os);
44+ // TODO(b/418738869): Incorrect for values not representing valid codepoints.
45+ // Also see https://github.com/google/googletest/issues/4762.
46+ PrintTo(static_cast<char32_t>(c), os);
47 }
48 #endif
49
diff --git a/meta-oe/recipes-dbs/leveldb/leveldb_1.23.bb b/meta-oe/recipes-dbs/leveldb/leveldb_1.23.bb
index 1ccf115793..90e0785e54 100644
--- a/meta-oe/recipes-dbs/leveldb/leveldb_1.23.bb
+++ b/meta-oe/recipes-dbs/leveldb/leveldb_1.23.bb
@@ -7,6 +7,7 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=92d1b128950b11ba8495b64938fc164d"
7SRC_URI = "gitsm://github.com/google/${BPN}.git;branch=main;protocol=https \ 7SRC_URI = "gitsm://github.com/google/${BPN}.git;branch=main;protocol=https \
8 file://0001-CMakeLists.txt-fix-googletest-related-options.patch \ 8 file://0001-CMakeLists.txt-fix-googletest-related-options.patch \
9 file://0001-Fix-printing-64-bit-integer-types.patch \ 9 file://0001-Fix-printing-64-bit-integer-types.patch \
10 file://0001-Use-static_cast-instead-of-ImplicitCast_-for-charact.patch \
10 file://run-ptest \ 11 file://run-ptest \
11" 12"
12 13