From 7384c7f0d46b3f3e98514ff6b438aca274e372fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89tienne=20Mollier?= Date: Thu, 25 Jul 2024 21:24:53 +0200 Subject: [PATCH] swig/Multiroots.i: fix build failure with gcc 14. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As identified in [Debian bug #1075182], Math::GSL fails to build with gcc 14 with the following kind of symptoms due to a number of warnings in the C compiler now gone fatal by default: xs/Multiroots_wrap.2.8.c:2950:12: error: assignment to ‘gsl_multiroot_function *’ {aka ‘struct gsl_multiroot_function_struct *’} from incompatible pointer type ‘gsl_multiroot_function **’ {aka ‘struct gsl_multiroot_function_struct **’} [-Wincompatible-pointer-types] 2950 | arg1 = &f; | ^ This change fixes/workarounds the issue by casting the &f pointer to the expected type. Other approaches trying to fix the native type of f straight away result in a segmentation faults while running tests, and any other approaches were anything but obvious due to entanglement with swig, but maybe there is something more appropriate than casting. [Debian bug #1075182]: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1075182 Signed-off-by: Étienne Mollier --- swig/Multiroots.i | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/swig/Multiroots.i b/swig/Multiroots.i index fd981d63..28ac644b 100644 --- a/swig/Multiroots.i +++ b/swig/Multiroots.i @@ -5,7 +5,7 @@ %typemap(in) gsl_multiroot_function * { gsl_multiroot_function *f; /* stub */ - $1 = &f; + $1 = (gsl_multiroot_function *)&f; } %{