From 126f6e630a69a3a6c081717da93c2f4f145085c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frank=20F=C3=B6rster?= Date: Wed, 20 May 2026 12:01:26 +0200 Subject: [PATCH] Fix K&R-style function declarations in rand.h incompatible with GCC 14+ (C23) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit GCC 14 changed the default C standard to C23, which redefines the meaning of empty parameter lists. In C23, `void func()` is equivalent to `void func(void)` — a function that takes no arguments. The declarations in rand.h used a technique of hiding parameters inside comments to make them invisible to the compiler: void randinit(/*_ randctx *r, word flag _*/); void isaac(/*_ randctx *r _*/); The C preprocessor strips comments before compilation, leaving: void randinit(); void isaac(); Under C23 this means "takes no arguments", which conflicts with the actual function definitions that do take parameters, causing a type mismatch and breaking the build with: error: conflicting types for 'isaac' This patch replaces the comment-hidden parameters with explicit declarations: void randinit(randctx *r, word flag); void isaac(randctx *r); Fixes build failure on GCC 14+ (e.g. Alpine Linux 3.23, Debian Trixie). --- rand.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rand.h b/rand.h index 73f6e3e..dbe12fe 100644 --- a/rand.h +++ b/rand.h @@ -36,9 +36,9 @@ typedef struct randctx randctx; If (flag==TRUE), then use the contents of randrsl[0..RANDSIZ-1] as the seed. ------------------------------------------------------------------------------ */ -void randinit(/*_ randctx *r, word flag _*/); +void randinit(randctx *r, word flag); -void isaac(/*_ randctx *r _*/); +void isaac(randctx *r); /*