From ff54fd9c756bce8106a99796402e691118fbcf89 Mon Sep 17 00:00:00 2001 From: Dario Binacchi Date: Fri, 17 Oct 2025 19:26:20 +0200 Subject: [PATCH] package/ledmon: add upstream patch to fix build w/ gcc-14 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add an upstream patch to fix a build issue related to uint64_t: utils.c: In function ‘get_uint64’: utils.c:118:18: error: passing argument 1 of ‘str_toul’ from incompatible pointer type [-Wincompatible-pointer-types] 118 | str_toul(&defval, p, NULL, 16); | ^~~~~~~ | | | uint64_t * {aka long long unsigned int *} In file included from utils.c:48: utils.h:412:29: note: expected ‘long unsigned int *’ but argument is of type ‘uint64_t *’ {aka ‘long long unsigned int *’} Fixes: https://autobuild.buildroot.org/results/51af1d7bf71061f22d49213951a5f6a9565710c3/ Signed-off-by: Dario Binacchi Signed-off-by: Julien Olivain (cherry picked from commit c8923662cc7e1f0a1d30d0926f979c21d36aa9df) Signed-off-by: Thomas Perale --- package/ledmon/0003-Correct-get_uint64.patch | 43 ++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 package/ledmon/0003-Correct-get_uint64.patch diff --git a/package/ledmon/0003-Correct-get_uint64.patch b/package/ledmon/0003-Correct-get_uint64.patch new file mode 100644 index 0000000000..2db4c04a6e --- /dev/null +++ b/package/ledmon/0003-Correct-get_uint64.patch @@ -0,0 +1,43 @@ +From ed747ac3540cb38797f56533f9f51f5627e6b994 Mon Sep 17 00:00:00 2001 +From: Tony Asleson +Date: Wed, 21 Aug 2024 12:27:28 -0500 +Subject: [PATCH] Correct get_uint64 + +For large integer values, the existing implementation will be +incorrect. + +The current implementation of converting strings to integer values +uses a signed integer for the intermediate conversion and performs +a range check. Since any value in an unsigned 64-bit integer is valid, +the range check seems unnecessary. To mimic the same code path, we would +need a larger integer type. + +Signed-off-by: Tony Asleson +Signed-off-by: Dario Binacchi +Upstream: https://github.com/intel/ledmon/commit/ed747ac3540cb38797f56533f9f51f5627e6b994 +--- + src/lib/utils.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +diff --git a/src/lib/utils.c b/src/lib/utils.c +index a7936c69b242..a6ee29ba7f22 100644 +--- a/src/lib/utils.c ++++ b/src/lib/utils.c +@@ -98,8 +98,12 @@ uint64_t get_uint64(const char *path, uint64_t defval, const char *name) + if (!p) + return defval; + +- str_toul(&defval, p, NULL, 16); +- return defval; ++ errno = 0; ++ uint64_t t = strtoull(p, NULL, 16); ++ ++ if (errno) ++ return defval; ++ return t; + } + + int get_int(const char *path, int defval, const char *name) +-- +2.43.0 +