From 50e6f65d6e5b546858a4172ca582fdd64dabf61f Mon Sep 17 00:00:00 2001 From: Kevin Collins Date: Fri, 26 Dec 2025 15:08:34 -0800 Subject: [PATCH] Fix function pointer type mismatch for strict C compilers Modern C compilers (particularly gcc with -std=c23 or Alpine's musl gcc) are stricter about function pointer type compatibility. This fixes a compilation error where loop_func parameter type didn't match the struct member declaration. Error was: ndloop.c:359:19: error: assignment to 'void (*)(void)' from incompatible pointer type The struct member at line 59 uses 'struct NA_MD_LOOP *' (forward declaration within the typedef), while the function parameter at line 334 used 'na_md_loop_t *'. Although these are the same type after typedef expansion, strict compilers require exact signature matching for function pointer assignments. Changed line 334 to use 'struct NA_MD_LOOP *' to match the struct member declaration, resolving the type incompatibility. --- ext/numo/narray/ndloop.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/numo/narray/ndloop.c b/ext/numo/narray/ndloop.c index 5cb3752d..c8da4265 100644 --- a/ext/numo/narray/ndloop.c +++ b/ext/numo/narray/ndloop.c @@ -331,7 +331,7 @@ ndloop_find_max_dimension(na_md_loop_t *lp, ndfunc_t *nf, VALUE args) static void ndloop_alloc(na_md_loop_t *lp, ndfunc_t *nf, VALUE args, void *opt_ptr, unsigned int copy_flag, - void (*loop_func)(ndfunc_t*, na_md_loop_t*)) + void (*loop_func)(ndfunc_t*, struct NA_MD_LOOP *)) { int i,j; int narg;