commit:     6a59a245e266dfcb2dff105f96913bfd94e3264d
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sat Dec 16 10:51:19 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Dec 16 10:51:41 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6a59a245

net-analyzer/httping: fix modern C issue

Closes: https://bugs.gentoo.org/920107
Signed-off-by: Sam James <sam <AT> gentoo.org>

 net-analyzer/httping/files/httping-2.9-c99.patch   | 35 ++++++++++++++++++++++
 .../{httping-2.9.ebuild => httping-2.9-r1.ebuild}  |  5 ++--
 2 files changed, 38 insertions(+), 2 deletions(-)

diff --git a/net-analyzer/httping/files/httping-2.9-c99.patch 
b/net-analyzer/httping/files/httping-2.9-c99.patch
new file mode 100644
index 000000000000..48e07219d4e8
--- /dev/null
+++ b/net-analyzer/httping/files/httping-2.9-c99.patch
@@ -0,0 +1,35 @@
+https://github.com/folkertvanheusden/HTTPing/pull/12
+
+From 684a6e255ea2f5b11a0548e5d99c2678be7563d9 Mon Sep 17 00:00:00 2001
+From: Sam James <s...@gentoo.org>
+Date: Sat, 16 Dec 2023 10:48:17 +0000
+Subject: [PATCH] http.c: add <stdlib.h> for malloc
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+GCC 14 makes implicit function declarations an error by default:
+```
+http.c: In function ‘get_HTTP_headers’:
+http.c:21:32: error: implicit declaration of function ‘malloc’ 
[-Wimplicit-function-declaration]
+   21 |         char *buffer = (char *)malloc(len + 1);
+      |                                ^~~~~~
+http.c:16:1: note: include ‘<stdlib.h>’ or provide a declaration of ‘malloc’
+   15 | #include "utils.h"
+  +++ |+#include <stdlib.h>
+   16 |
+[...]
+```
+
+Bug: https://bugs.gentoo.org/920107
+Signed-off-by: Sam James <s...@gentoo.org>
+--- a/http.c
++++ b/http.c
+@@ -2,6 +2,7 @@
+ 
+ #include <assert.h>
+ #include <stdio.h>
++#include <stdlib.h>
+ #include <string.h>
+ #include <unistd.h>
+ #ifndef NO_SSL

diff --git a/net-analyzer/httping/httping-2.9.ebuild 
b/net-analyzer/httping/httping-2.9-r1.ebuild
similarity index 94%
rename from net-analyzer/httping/httping-2.9.ebuild
rename to net-analyzer/httping/httping-2.9-r1.ebuild
index 9bfb0a57e5f1..a9db3b0d13f7 100644
--- a/net-analyzer/httping/httping-2.9.ebuild
+++ b/net-analyzer/httping/httping-2.9-r1.ebuild
@@ -17,8 +17,8 @@ IUSE="debug fftw l10n_nl ncurses ssl +tfo"
 
 RDEPEND="
        fftw? ( sci-libs/fftw:3.0 )
-       ncurses? ( sys-libs/ncurses:0= )
-       ssl? ( dev-libs/openssl:0= )
+       ncurses? ( sys-libs/ncurses:= )
+       ssl? ( dev-libs/openssl:= )
 "
 DEPEND="${RDEPEND}"
 BDEPEND="ncurses? ( virtual/pkgconfig )"
@@ -29,6 +29,7 @@ RESTRICT="test"
 
 PATCHES=(
        "${FILESDIR}"/${PN}-2.2.1-flags.patch
+       "${FILESDIR}"/${PN}-2.9-c99.patch
 )
 
 src_prepare() {

Reply via email to