mirror of
https://github.com/openembedded/meta-openembedded.git
synced 2026-06-12 17:20:13 +00:00
kronosnet: Fix build with gcc-12
Fix the build failure when debug build is enabled. Add DEBUG_BUILD = "1" in conf/local.conf. $ bitbake kronosnet | /build/tmp-glibc/work/corei7-64-wrs-linux/kronosnet/1.22-r0/recipe-sysroot/usr/include/bits/string_fortified.h:59:10: error: 'link' may be used uninitialized [-Werror=maybe-uninitialized] | 59 | return __builtin___memset_chk (__dest, __ch, __len, | | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | 60 | __glibc_objsize0 (__dest)); | | ~~~~~~~~~~~~~~~~~~~~~~~~~~ | ../../git/libknet/links.c: In function 'knet_link_set_config': | ../../git/libknet/links.c:108:27: note: 'link' was declared here | 108 | struct knet_link *link; | | ^~~~ | cc1: all warnings being treated as errors Signed-off-by: Mingli Yu <mingli.yu@windriver.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
+40
@@ -0,0 +1,40 @@
|
|||||||
|
From a8aac8f3fd8b07fde8f5dc0aa9ece54a46d24425 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Mingli Yu <mingli.yu@windriver.com>
|
||||||
|
Date: Thu, 9 Jun 2022 16:03:06 +0800
|
||||||
|
Subject: [PATCH] links.c: Fix build with gcc-12
|
||||||
|
|
||||||
|
Fixes:
|
||||||
|
| /build/tmp-glibc/work/corei7-64-wrs-linux/kronosnet/1.22-r0/recipe-sysroot/usr/include/bits/string_fortified.h:59:10: error: 'link' may be used uninitialized [-Werror=maybe-uninitialized]
|
||||||
|
| 59 | return __builtin___memset_chk (__dest, __ch, __len,
|
||||||
|
| | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
| 60 | __glibc_objsize0 (__dest));
|
||||||
|
| | ~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
| ../../git/libknet/links.c: In function 'knet_link_set_config':
|
||||||
|
| ../../git/libknet/links.c:108:27: note: 'link' was declared here
|
||||||
|
| 108 | struct knet_link *link;
|
||||||
|
| | ^~~~
|
||||||
|
| cc1: all warnings being treated as errors
|
||||||
|
|
||||||
|
Upstream-Status: Submitted[https://github.com/kronosnet/kronosnet/pull/382]
|
||||||
|
|
||||||
|
Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
|
||||||
|
---
|
||||||
|
libknet/links.c | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/libknet/links.c b/libknet/links.c
|
||||||
|
index 8cb1621b..0ef42b79 100644
|
||||||
|
--- a/libknet/links.c
|
||||||
|
+++ b/libknet/links.c
|
||||||
|
@@ -105,7 +105,7 @@ int knet_link_set_config(knet_handle_t knet_h, knet_node_id_t host_id, uint8_t l
|
||||||
|
{
|
||||||
|
int savederrno = 0, err = 0, i, wipelink = 0, link_idx;
|
||||||
|
struct knet_host *host, *tmp_host;
|
||||||
|
- struct knet_link *link;
|
||||||
|
+ struct knet_link *link = NULL;
|
||||||
|
|
||||||
|
if (!_is_valid_handle(knet_h)) {
|
||||||
|
return -1;
|
||||||
|
--
|
||||||
|
2.25.1
|
||||||
|
|
||||||
@@ -14,6 +14,7 @@ DEPENDS = "doxygen-native libqb-native libxml2-native bzip2 libqb libxml2 libnl
|
|||||||
SRCREV = "0123ecebce0ad6aba3cdb320027192e15fd71e23"
|
SRCREV = "0123ecebce0ad6aba3cdb320027192e15fd71e23"
|
||||||
SRC_URI = "git://github.com/kronosnet/kronosnet;protocol=https;branch=stable1 \
|
SRC_URI = "git://github.com/kronosnet/kronosnet;protocol=https;branch=stable1 \
|
||||||
file://0001-libknet-tests-Correct-include-path-for-poll.h.patch \
|
file://0001-libknet-tests-Correct-include-path-for-poll.h.patch \
|
||||||
|
file://0001-links.c-Fix-build-with-gcc-12.patch \
|
||||||
"
|
"
|
||||||
|
|
||||||
UPSTREAM_CHECK_URI = "https://github.com/kronosnet/kronosnet/releases"
|
UPSTREAM_CHECK_URI = "https://github.com/kronosnet/kronosnet/releases"
|
||||||
|
|||||||
Reference in New Issue
Block a user