Control: tag -1 patch

On Wed, Jul 03, 2024 at 12:27:01PM +0000, Matthias Klose wrote:
> Package: src:fungw
> Version: 1.2.1-3
> Severity: important
> Tags: sid trixie
> User: debian-...@lists.debian.org
> Usertags: ftbfs-gcc-14

> fungw_perl.c: In function ‘fgws_perl_init’:
> fungw_perl.c:286:37: error: assignment to ‘XPV *’ {aka ‘struct xpv *’} from 
> incompatible pointer type ‘perl_ctx_t *’ [-Wincompatible-pointer-types]
>   286 |         ctx->interp->perl_user_data = ctx;
>       |                                     ^
> make[3]: *** [Makefile:36: fungw_perl.o] Error 1

This always warned, but became an error with GCC 14 (already in sid,
so the bug is release critical now.)

The attached patch fixes the build by adding a cast to a void
pointer. I haven't tested the build results in any way.

Hope this helps,
-- 
Niko Tyni   nt...@debian.org
From: Niko Tyni <nt...@debian.org>
Date: Fri, 2 Aug 2024 08:44:28 +0100
X-Dgit-Generated: 1.2.1-3 dd68747f561a8cb027d3a3d53cec0d1d48712da5
Subject: Add explicit void pointer cast for Perl user data

This fixes a compilation error on GCC 14.

Quoting https://gcc.gnu.org/gcc-14/porting_to.html

  GCC no longer allows implicitly casting all pointer types to all
  other pointer types. This behavior is now restricted to the void *
  type and its qualified variations.

  To fix compilation errors resulting from that, you can add the
  appropriate casts, and maybe consider using void * in more places
  (particularly for old programs that predate the introduction of void *
  into the C language).

Bug-Debian: https://bugs.debian.org/1074973

---

diff --git a/libfungwbind/perl/fungw_perl.c b/libfungwbind/perl/fungw_perl.c
index 2b3a91e..a8580bc 100644
--- a/libfungwbind/perl/fungw_perl.c
+++ b/libfungwbind/perl/fungw_perl.c
@@ -283,7 +283,7 @@ static int fgws_perl_init(fgw_obj_t *obj, const char *filename, const char *opts
 	PERL_SET_CONTEXT(ctx->interp);
 	perl_construct(ctx->interp);
 	obj->script_data = ctx;
-	ctx->interp->perl_user_data = ctx;
+	ctx->interp->perl_user_data = (void *)ctx;
 	ctx->obj = obj;
 	ctx->freg_delay = 1;
 

Reply via email to