[OS-BUILD PATCH] Workaround for gcc12 compile issues in ubcmd-util.h

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Justin M. Forbes <jforbes@xxxxxxxxxxxxxxxxx>

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 <jforbes@xxxxxxxxxxxxxxxxx>

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@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to kernel-leave@xxxxxxxxxxxxxxxxxxxxxxx
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@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam on the list, report it: https://pagure.io/fedora-infrastructure




[Index of Archives]     [Fedora General Discussion]     [Older Fedora Users Archive]     [Fedora Advisory Board]     [Fedora Security]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Mentors]     [Fedora Package Announce]     [Fedora Package Review]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Coolkey]     [Yum Users]     [Tux]     [Yosemite News]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [USB]     [Asterisk PBX]

  Powered by Linux