From 2fe2f967f9c4183d8e5f233c6a4a8daabb51558d Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Mon, 7 Sep 2026 19:20:40 -0700 Subject: [PATCH] pcapplusplus: Fix build with clang-23 Signed-off-by: Khem Raj --- ...lign-template-inline-instead-of-stat.patch | 34 +++++++++++++++++++ .../pcapplusplus/pcapplusplus_26.07.bb | 3 +- 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 meta-oe/recipes-connectivity/pcapplusplus/pcapplusplus/0001-Common-declare-align-template-inline-instead-of-stat.patch diff --git a/meta-oe/recipes-connectivity/pcapplusplus/pcapplusplus/0001-Common-declare-align-template-inline-instead-of-stat.patch b/meta-oe/recipes-connectivity/pcapplusplus/pcapplusplus/0001-Common-declare-align-template-inline-instead-of-stat.patch new file mode 100644 index 0000000000..e796b6e35d --- /dev/null +++ b/meta-oe/recipes-connectivity/pcapplusplus/pcapplusplus/0001-Common-declare-align-template-inline-instead-of-stat.patch @@ -0,0 +1,34 @@ +From fe044dbd8459924558c0965833b8f1e78c8921ea Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Tue, 8 Sep 2026 02:16:00 +0000 +Subject: [PATCH] Common++: declare align() template inline instead of static + +Newer clang (23+) enables -Wunused-template for namespace-scope static +function templates defined in headers, which fails the -Werror build for +every translation unit that includes GeneralUtils.h without using +align(): + + Common++/header/GeneralUtils.h:50:38: error: unused function template 'align' [-Werror,-Wunused-template] + +Declare it inline instead; that is the correct linkage for a template +defined in a header and does not trigger the warning. + +Upstream-Status: Pending +Signed-off-by: Khem Raj +--- + Common++/header/GeneralUtils.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Common++/header/GeneralUtils.h b/Common++/header/GeneralUtils.h +index 060acb4c..ba5428d6 100644 +--- a/Common++/header/GeneralUtils.h ++++ b/Common++/header/GeneralUtils.h +@@ -47,7 +47,7 @@ namespace pcpp + /// Calculates alignment. + /// @param[in] number Given number + /// @return The aligned number +- template static int align(int number) ++ template inline int align(int number) + { + // Only works for alignment with power of 2 + constexpr bool isPowerOfTwo = alignment && ((alignment & (alignment - 1)) == 0); diff --git a/meta-oe/recipes-connectivity/pcapplusplus/pcapplusplus_26.07.bb b/meta-oe/recipes-connectivity/pcapplusplus/pcapplusplus_26.07.bb index 948a694a8c..eff0b75072 100644 --- a/meta-oe/recipes-connectivity/pcapplusplus/pcapplusplus_26.07.bb +++ b/meta-oe/recipes-connectivity/pcapplusplus/pcapplusplus_26.07.bb @@ -7,7 +7,8 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=911690f51af322440237a253d695d19f" DEPENDS = "libpcap" -SRC_URI = "git://github.com/seladb/PcapPlusPlus.git;protocol=https;branch=master;tag=v${PV}" +SRC_URI = "git://github.com/seladb/PcapPlusPlus.git;protocol=https;branch=master;tag=v${PV} \ + file://0001-Common-declare-align-template-inline-instead-of-stat.patch" SRCREV = "0dbbb9c75eb232135f13fdb794318c4da3270ebc"