From: Justin M. Forbes <jfor...@fedoraproject.org>

Workaround for gcc12 compile issues in ubcmd-util.h

While upstream has made no move around this and I am not positive that
this is the "proper" fix for upstream, it does get us building again for
several arches. This is being added as "include in release" until
upstream weighs in so that at least ark-latest builds for many
architectures.  There are still issues with gcc12 and armv7.

Signed-off-by: Justin M. Forbes <jfor...@fedoraproject.org>

diff --git a/tools/lib/subcmd/subcmd-util.h b/tools/lib/subcmd/subcmd-util.h
index blahblah..blahblah 100644
--- a/tools/lib/subcmd/subcmd-util.h
+++ b/tools/lib/subcmd/subcmd-util.h
@@ -49,13 +49,12 @@ static NORETURN inline void die(const char *err, ...)
 
 static inline void *xrealloc(void *ptr, size_t size)
 {
-       void *ret = realloc(ptr, size);
-       if (!ret && !size)
-               ret = realloc(ptr, 1);
+       void *ret;
+       if (!size)
+               size = 1;
+       ret = realloc(ptr, size);
        if (!ret) {
                ret = realloc(ptr, size);
-               if (!ret && !size)
-                       ret = realloc(ptr, 1);
                if (!ret)
                        die("Out of memory, realloc failed");
        }

--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1594
_______________________________________________
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/kernel@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure

Reply via email to