From: Wang Mingyu <[email protected]> Comparator objects used in standard containers (such as std::set) must be invocable as const. Opensaf contains several comparators that lack the 'const' qualifier, leading to compilation failures like:
error: passing 'const XxxCompare*' as 'this' argument discards qualifiers Add a backported patch to fix the comparators in imm_xmlw_dump.cc and amfd/node.h by adding the missing 'const' to operator(). Signed-off-by: Wang Mingyu <[email protected]> --- .../0001-fix-NodeNameCompare-const.patch | 56 +++++++++++++++++++ .../opensaf/opensaf_5.26.02.bb | 1 + 2 files changed, 57 insertions(+) create mode 100644 meta-networking/recipes-daemons/opensaf/opensaf/0001-fix-NodeNameCompare-const.patch diff --git a/meta-networking/recipes-daemons/opensaf/opensaf/0001-fix-NodeNameCompare-const.patch b/meta-networking/recipes-daemons/opensaf/opensaf/0001-fix-NodeNameCompare-const.patch new file mode 100644 index 0000000000..957f01e89d --- /dev/null +++ b/meta-networking/recipes-daemons/opensaf/opensaf/0001-fix-NodeNameCompare-const.patch @@ -0,0 +1,56 @@ +From 5e9f2fd4c73c9e0b666290934227200f2515f206 Mon Sep 17 00:00:00 2001 +From: Wang Mingyu <[email protected]> +Date: Mon, 15 Jun 2026 03:32:05 +0000 +Subject: [PATCH] fix NodeNameCompare const + +Upstream-Status: Submitted [sourceforge] + +Signed-off-by: Wang Mingyu <[email protected]> +--- + src/amf/amfd/node.cc | 2 +- + src/amf/amfd/node.h | 2 +- + src/imm/tools/imm_xmlw_dump.cc | 2 +- + 3 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/src/amf/amfd/node.cc b/src/amf/amfd/node.cc +index 04f35e7..9785a01 100644 +--- a/src/amf/amfd/node.cc ++++ b/src/amf/amfd/node.cc +@@ -43,7 +43,7 @@ bool operator<(const AVD_AVND &lhs, const AVD_AVND &rhs) { + } + } + +-bool NodeNameCompare::operator()(const AVD_AVND *lhs, const AVD_AVND *rhs) { ++bool NodeNameCompare::operator()(const AVD_AVND *lhs, const AVD_AVND *rhs) const { + return *lhs < *rhs; + } + +diff --git a/src/amf/amfd/node.h b/src/amf/amfd/node.h +index 3456adb..c6527d5 100644 +--- a/src/amf/amfd/node.h ++++ b/src/amf/amfd/node.h +@@ -170,7 +170,7 @@ struct NodeNameCompare + typedef AVD_AVND first_argument_type; + typedef AVD_AVND second_argument_type; + typedef bool result_type; +- bool operator()(const AVD_AVND *lhs, const AVD_AVND *rhs); ++ bool operator()(const AVD_AVND *lhs, const AVD_AVND *rhs) const; + }; + + extern AmfDb<std::string, AVD_AVND> *node_name_db; +diff --git a/src/imm/tools/imm_xmlw_dump.cc b/src/imm/tools/imm_xmlw_dump.cc +index f8474c3..2da9bef 100644 +--- a/src/imm/tools/imm_xmlw_dump.cc ++++ b/src/imm/tools/imm_xmlw_dump.cc +@@ -39,7 +39,7 @@ typedef struct { + + /* Comparision object for Object */ + struct ObjectComp { +- bool operator()(const Object& lhs, const Object& rhs) { ++ bool operator()(const Object& lhs, const Object& rhs) const { + return (lhs.reversedDn.compare(rhs.reversedDn) < 0) ? true : false; + } + }; +-- +2.43.0 + diff --git a/meta-networking/recipes-daemons/opensaf/opensaf_5.26.02.bb b/meta-networking/recipes-daemons/opensaf/opensaf_5.26.02.bb index eede11515b..bc022c44d6 100644 --- a/meta-networking/recipes-daemons/opensaf/opensaf_5.26.02.bb +++ b/meta-networking/recipes-daemons/opensaf/opensaf_5.26.02.bb @@ -29,6 +29,7 @@ SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/releases/${BPN}-${PV}.tar.gz \ file://0001-Use-correct-printf-format-for-__fsblkcnt_t.patch \ file://0002-configure-Disable-selected-warnings.patch \ file://0001-To-fix-Werror-discarded-qualifiers-error.patch \ + file://0001-fix-NodeNameCompare-const.patch \ " SRC_URI[sha256sum] = "c51603bc486ce6db271a7023a75963bfc6f277f4d4486df2fe004a51c81cfdee" -- 2.43.0
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#127579): https://lists.openembedded.org/g/openembedded-devel/message/127579 Mute This Topic: https://lists.openembedded.org/mt/119811087/21656 Group Owner: [email protected] Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [[email protected]] -=-=-=-=-=-=-=-=-=-=-=-
