commit:     7059477384130421a2c4c1eaefc5047dcf3c4e7d
Author:     Sungjoon Moon <sumoon <AT> seoulsaram <DOT> org>
AuthorDate: Thu May 29 15:42:09 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu May 29 16:48:22 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=70594773

sys-devel/flex: patch to fix the malloc prototype

Source: https://github.com/westes/flex/pull/674

Closes: https://bugs.gentoo.org/956581
Signed-off-by: Sungjoon Moon <sumoon <AT> seoulsaram.org>
Part-of: https://github.com/gentoo/gentoo/pull/42331
Closes: https://github.com/gentoo/gentoo/pull/42331
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../files/flex-2.6.4-fix-malloc-prototype.patch    | 26 ++++++++++++++++++++++
 sys-devel/flex/flex-2.6.4-r6.ebuild                |  1 +
 2 files changed, 27 insertions(+)

diff --git a/sys-devel/flex/files/flex-2.6.4-fix-malloc-prototype.patch 
b/sys-devel/flex/files/flex-2.6.4-fix-malloc-prototype.patch
new file mode 100644
index 000000000000..9ded7cd40eaf
--- /dev/null
+++ b/sys-devel/flex/files/flex-2.6.4-fix-malloc-prototype.patch
@@ -0,0 +1,26 @@
+Bug: https://bugs.gentoo.org/956581
+https://github.com/westes/flex/pull/674
+https://github.com/westes/flex/commit/4b142954b54a57a9b0af0a9661056a9c39a8fa95
+
+From bf254c75b1e0d2641ebbd7fc85fb183f36a62ea7 Mon Sep 17 00:00:00 2001
+From: Richard Barnes <[email protected]>
+Date: Wed, 2 Oct 2024 10:35:09 -0700
+Subject: [PATCH] Match `malloc` signature to its use
+
+---
+ lib/malloc.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/malloc.c b/lib/malloc.c
+index 75e8ef97c..701b9b39d 100755
+--- a/lib/malloc.c
++++ b/lib/malloc.c
+@@ -3,7 +3,7 @@
+      
+      #include <sys/types.h>
+      
+-     void *malloc ();
++     void *malloc (size_t n);
+      
+      /* Allocate an N-byte block of memory from the heap.
+         If N is zero, allocate a 1-byte block.  */

diff --git a/sys-devel/flex/flex-2.6.4-r6.ebuild 
b/sys-devel/flex/flex-2.6.4-r6.ebuild
index c024ea00fe94..3a5e1b6a6454 100644
--- a/sys-devel/flex/flex-2.6.4-r6.ebuild
+++ b/sys-devel/flex/flex-2.6.4-r6.ebuild
@@ -29,6 +29,7 @@ PATCHES=(
        "${FILESDIR}"/${P}-libobjdir.patch
        "${FILESDIR}"/${P}-fix-build-with-glibc2.26.patch
        "${FILESDIR}"/${P}-fix-apple-m1-crash-by-explicit-pointer-cast.patch
+       "${FILESDIR}"/${P}-fix-malloc-prototype.patch
 
        "${WORKDIR}"/${P}-autotools-regenerate.patch
 )

Reply via email to