commit:     ae6ebec35243abea4be476f4f345837e26d81bd8
Author:     Vladislav Mikhailikov <vmikhailikov <AT> gmail <DOT> com>
AuthorDate: Tue Feb 10 19:16:46 2026 +0000
Commit:     David Seifert <soap <AT> gentoo <DOT> org>
CommitDate: Tue Feb 10 19:16:46 2026 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ae6ebec3

net-analyzer/ttcp: fix GCC 15.x issues

Closes: https://bugs.gentoo.org/945186
Closes: https://github.com/gentoo/gentoo/pull/44675
Signed-off-by: Vladislav Mikhailikov <vmikhailikov <AT> gmail.com>
Signed-off-by: David Seifert <soap <AT> gentoo.org>

 net-analyzer/ttcp/files/ttcp-1.12-c23.patch | 77 +++++++++++++++++++++++++++++
 net-analyzer/ttcp/ttcp-1.12-r3.ebuild       |  4 +-
 2 files changed, 80 insertions(+), 1 deletion(-)

diff --git a/net-analyzer/ttcp/files/ttcp-1.12-c23.patch 
b/net-analyzer/ttcp/files/ttcp-1.12-c23.patch
new file mode 100644
index 000000000000..a5c458b9765e
--- /dev/null
+++ b/net-analyzer/ttcp/files/ttcp-1.12-c23.patch
@@ -0,0 +1,77 @@
+Fix GCC 15.x issues.
+
+--- a/ttcp.c
++++ b/ttcp.c
+@@ -157,16 +157,16 @@
+ unsigned long numCalls;               /* # of I/O system calls */
+ double cput, realt;           /* user, real time (seconds) */
+ 
+-void err();
+-void mes();
+-void pattern();
++void err(const char *);
++void mes(const char *);
++void pattern(register char *, register int);
+ void prep_timer();
+-double read_timer();
+-int Nread();
+-int Nwrite();
+-void delay();
+-int mread();
+-char *outfmt();
++double read_timer(char *, int);
++int Nread(int, void *, int);
++int Nwrite(int, void *, int);
++void delay(int);
++int mread(int, register char *, unsigned int);
++char *outfmt(const double);
+ 
+ int
+ main(int argc, char **argv)
+@@ -560,7 +560,7 @@
+ }
+ 
+ void
+-err(char *s)
++err(const char *s)
+ {
+       fprintf(stderr, "ttcp%s: ", trans ? "-t" : "-r");
+       perror(s);
+@@ -569,7 +569,7 @@
+ }
+ 
+ void
+-mes(char *s)
++mes(const char *s)
+ {
+       fprintf(stderr, "ttcp%s: %s\n", trans ? "-t" : "-r", s);
+ }
+@@ -586,7 +586,7 @@
+ }
+ 
+ char *
+-outfmt(double b)
++outfmt(const double b)
+ {
+     static char obuf[50];
+     switch (fmt) {
+@@ -616,10 +616,15 @@
+ static struct timeval time0;  /* Time at which timing started */
+ static struct rusage ru0;     /* Resource utilization at the start */
+ 
+-static void prusage();
+-static void tvadd();
+-static void tvsub();
+-static void psecs();
++static void prusage(
++      register struct rusage *,
++      register struct rusage *,
++      struct timeval *,
++      struct timeval *,
++      char *);
++static void tvadd(struct timeval *, struct timeval *, struct timeval *);
++static void tvsub(struct timeval *, struct timeval *, struct timeval *);
++static void psecs(long, register char *);
+ 
+ /*
+  *                    P R E P _ T I M E R

diff --git a/net-analyzer/ttcp/ttcp-1.12-r3.ebuild 
b/net-analyzer/ttcp/ttcp-1.12-r3.ebuild
index b33de09f14cc..1f7b7059b640 100644
--- a/net-analyzer/ttcp/ttcp-1.12-r3.ebuild
+++ b/net-analyzer/ttcp/ttcp-1.12-r3.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2022 Gentoo Authors
+# Copyright 1999-2026 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=8
@@ -17,6 +17,8 @@ LICENSE="public-domain"
 SLOT="0"
 KEYWORDS="~amd64 ~hppa ~mips ~ppc ~sparc ~x86"
 
+PATCHES=( "${FILESDIR}"/${P}-c23.patch )
+
 src_prepare() {
        cp "${DISTDIR}"/${P}.c ${PN}.c || die
        default

Reply via email to