Installation fails on Fedora 43
See https://github.com/red-data-tools/red_amber/pull/303#issuecomment-2751301962
Fedora 42 (current stable release) is affected as well. I'm getting the same build error as shown in the thread you linked.
$ ruby --version
ruby 3.4.2 (2025-02-15 revision d2930f8e7a) +PRISM [x86_64-linux]
$ gcc --version
gcc (GCC) 15.0.1 20250329 (Red Hat 15.0.1-0)
Ok. Will work on fixing it later this week.
Same error here with Ruby 3.3.7 and GCC 15.0.1 20250329. Any ideas on how to patch it at least temporarily?
These days AI is so good that it can quickly identify the cause of the problem.
Fixed the compilation issue with numo-narray on Fedora 43.
- Added forward declaration of struct:
struct NA_MD_LOOP; - Specified function pointer type:
void (*loop_func)(ndfunc_t*, struct NA_MD_LOOP*);
Root Cause
- The struct was self-referencing
- Function pointer type was imprecise
- Newer GCC enforces stricter type checking, causing errors
This fix allows numo-narray to compile successfully on Fedora 43 environments.
diff --git a/ext/numo/narray/ndloop.c b/ext/numo/narray/ndloop.c
index 7a3b74c..214f328 100644
--- a/ext/numo/narray/ndloop.c
+++ b/ext/numo/narray/ndloop.c
@@ -38,6 +38,8 @@ typedef struct NA_LOOP_XARGS {
bool free_user_iter; // alloc LARG(lp,j).iter=lp->xargs[j].iter
} na_loop_xargs_t;
+struct NA_MD_LOOP;
+
typedef struct NA_MD_LOOP {
int narg;
int nin;
@@ -56,7 +58,7 @@ typedef struct NA_MD_LOOP {
VALUE reduce;
VALUE loop_opt;
ndfunc_t *ndfunc;
- void (*loop_func)();
+ void (*loop_func)(ndfunc_t*, struct NA_MD_LOOP*);
} na_md_loop_t;
#define LARG(lp,iarg) ((lp)->user.args[iarg])
@kojix2 I can confirm it works. Thanks!
Can anymore release this, Please?