openembedded-devel.lists.openembedded.org archive mirror
 help / color / mirror / Atom feed
* [meta-oe][PATCH 1/2] librelp: Fix build with gcc-14
@ 2024-05-07  1:10 Khem Raj
  2024-05-07  1:10 ` [meta-oe][PATCH 2/2] pcapplusplus: Fix build with gcc14 Khem Raj
  0 siblings, 1 reply; 2+ messages in thread
From: Khem Raj @ 2024-05-07  1:10 UTC (permalink / raw)
  To: openembedded-devel; +Cc: Khem Raj

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 ...gainst-upcoming-gcc-14-Werror-calloc.patch | 37 +++++++++++++++++++
 .../rsyslog/librelp_1.11.0.bb                 |  1 +
 2 files changed, 38 insertions(+)
 create mode 100644 meta-oe/recipes-extended/rsyslog/librelp/0001-relp-fix-build-against-upcoming-gcc-14-Werror-calloc.patch

diff --git a/meta-oe/recipes-extended/rsyslog/librelp/0001-relp-fix-build-against-upcoming-gcc-14-Werror-calloc.patch b/meta-oe/recipes-extended/rsyslog/librelp/0001-relp-fix-build-against-upcoming-gcc-14-Werror-calloc.patch
new file mode 100644
index 0000000000..cf4f4080a6
--- /dev/null
+++ b/meta-oe/recipes-extended/rsyslog/librelp/0001-relp-fix-build-against-upcoming-gcc-14-Werror-calloc.patch
@@ -0,0 +1,37 @@
+From baf992f82aa987c608731866876adb856847ea45 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 6 May 2024 18:03:40 -0700
+Subject: [PATCH] relp: fix build against upcoming `gcc-14`
+ (`-Werror=calloc-transposed-args`)
+
+`gcc-14` added a new `-Wcalloc-transposed-args` warning recently. It
+   detected minor infelicity in `calloc()` API usage
+
+Fixes
+../../git/src/relp.c: In function 'addToEpollSet':
+../../git/src/relp.c:101:39: error: 'calloc' sizes specified with 'sizeof' in the earlier argument and not in the later argument [-Werror=calloc-transposed-args]
+  101 |         CHKmalloc(epd = calloc(sizeof(epolld_t), 1));
+      |                                       ^~~~~~~~
+
+Upstream-Status: Submitted [https://github.com/rsyslog/librelp/pull/264]
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/relp.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/relp.c b/src/relp.c
+index eadda36..6268f1d 100644
+--- a/src/relp.c
++++ b/src/relp.c
+@@ -98,7 +98,7 @@ addToEpollSet(relpEngine_t *const pThis, epolld_type_t typ, void *ptr, int sock,
+ 	epolld_t *epd = NULL;
+ 	ENTER_RELPFUNC;
+ 
+-	CHKmalloc(epd = calloc(sizeof(epolld_t), 1));
++	CHKmalloc(epd = calloc(1, sizeof(epolld_t)));
+ 	epd->typ = typ;
+ 	epd->ptr = ptr;
+ 	epd->sock = sock;
+-- 
+2.45.0
+
diff --git a/meta-oe/recipes-extended/rsyslog/librelp_1.11.0.bb b/meta-oe/recipes-extended/rsyslog/librelp_1.11.0.bb
index 9d949c6303..49847047ac 100644
--- a/meta-oe/recipes-extended/rsyslog/librelp_1.11.0.bb
+++ b/meta-oe/recipes-extended/rsyslog/librelp_1.11.0.bb
@@ -11,6 +11,7 @@ SRC_URI = "git://github.com/rsyslog/librelp.git;protocol=https;branch=stable \
            file://0001-tests-Fix-callback-prototype.patch \
            file://0001-tcp-fix-some-compiler-warnings-with-enable-tls-opens.patch \
            file://0001-tests-Include-missing-sys-time.h.patch \
+           file://0001-relp-fix-build-against-upcoming-gcc-14-Werror-calloc.patch \
            file://run-ptest \
 "
 
-- 
2.45.0



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [meta-oe][PATCH 2/2] pcapplusplus: Fix build with gcc14
  2024-05-07  1:10 [meta-oe][PATCH 1/2] librelp: Fix build with gcc-14 Khem Raj
@ 2024-05-07  1:10 ` Khem Raj
  0 siblings, 0 replies; 2+ messages in thread
From: Khem Raj @ 2024-05-07  1:10 UTC (permalink / raw)
  To: openembedded-devel; +Cc: Khem Raj

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 .../0001-initialize-timespec-variable.patch   | 35 +++++++++++++++++++
 .../pcapplusplus/pcapplusplus_23.09.bb        |  4 ++-
 2 files changed, 38 insertions(+), 1 deletion(-)
 create mode 100644 meta-oe/recipes-connectivity/pcapplusplus/pcapplusplus/0001-initialize-timespec-variable.patch

diff --git a/meta-oe/recipes-connectivity/pcapplusplus/pcapplusplus/0001-initialize-timespec-variable.patch b/meta-oe/recipes-connectivity/pcapplusplus/pcapplusplus/0001-initialize-timespec-variable.patch
new file mode 100644
index 0000000000..f2e210fc67
--- /dev/null
+++ b/meta-oe/recipes-connectivity/pcapplusplus/pcapplusplus/0001-initialize-timespec-variable.patch
@@ -0,0 +1,35 @@
+From 298dec6f87061914c85049faca3d0ff3310d1794 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 6 May 2024 12:15:30 -0700
+Subject: [PATCH] initialize timespec variable
+
+Fixes build warnings with GCC14
+
+/mnt/b/yoe/master/build/tmp/work/core2-32-yoe-linux/pcapplusplus/23.09/git/Packet++/src/RawPacket.cpp: In constructor 'pcpp::RawPacket::RawPacket(const uint8_t*, int, timeval, bool, pcpp::LinkLayerType)':
+/mnt/b/yoe/master/build/tmp/work/core2-32-yoe-linux/pcapplusplus/23.09/git/Packet++/src/RawPacket.cpp:23:18: error: 'nsec_time.timespec::<anonymous>' is used uninitialized [-Werror=uninitialized]
+   23 |         timespec nsec_time;
+      |                  ^~~~~~~~~
+cc1plus: all warnings being treated as errors
+
+Upstream-Status: Submitted [https://github.com/seladb/PcapPlusPlus/pull/1389]
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ Packet++/src/RawPacket.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Packet++/src/RawPacket.cpp b/Packet++/src/RawPacket.cpp
+index 8ad52d52..07dbbbe2 100644
+--- a/Packet++/src/RawPacket.cpp
++++ b/Packet++/src/RawPacket.cpp
+@@ -20,7 +20,7 @@ void RawPacket::init(bool deleteRawDataAtDestructor)
+ 
+ RawPacket::RawPacket(const uint8_t* pRawData, int rawDataLen, timeval timestamp, bool deleteRawDataAtDestructor, LinkLayerType layerType)
+ {
+-	timespec nsec_time;
++	timespec nsec_time = {};
+ 	TIMEVAL_TO_TIMESPEC(&timestamp, &nsec_time);
+ 	init(deleteRawDataAtDestructor);
+ 	setRawData(pRawData, rawDataLen, nsec_time, layerType);
+-- 
+2.45.0
+
diff --git a/meta-oe/recipes-connectivity/pcapplusplus/pcapplusplus_23.09.bb b/meta-oe/recipes-connectivity/pcapplusplus/pcapplusplus_23.09.bb
index 39c6942c83..0ce4885ab7 100644
--- a/meta-oe/recipes-connectivity/pcapplusplus/pcapplusplus_23.09.bb
+++ b/meta-oe/recipes-connectivity/pcapplusplus/pcapplusplus_23.09.bb
@@ -7,7 +7,9 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=911690f51af322440237a253d695d19f"
 
 DEPENDS = "libpcap"
 
-SRC_URI = "git://github.com/seladb/PcapPlusPlus.git;protocol=https;branch=master"
+SRC_URI = "git://github.com/seladb/PcapPlusPlus.git;protocol=https;branch=master \
+           file://0001-initialize-timespec-variable.patch"
+
 SRCREV = "4cf8ed44f9dd145f874dc1dd747dfefcfcab75be"
 
 S = "${WORKDIR}/git"
-- 
2.45.0



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-05-07  1:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-07  1:10 [meta-oe][PATCH 1/2] librelp: Fix build with gcc-14 Khem Raj
2024-05-07  1:10 ` [meta-oe][PATCH 2/2] pcapplusplus: Fix build with gcc14 Khem Raj

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).