Affected systems: Ubuntu 26.04
Recent versions of GCC (e.g. 15) enforce the C23 standard by default, which treats an empty parameter list in a function definition as explicitly meaning that the function takes no arguments.
Prior to C23, an empty parameter list was allowed to signal that the number of arguments and their types could vary.
Specifically, this issue affects the declared function definition: typedef void (*void_fn_t)();, which is later used as func() with either 1 or 2 arguments, depending on the context. This causes the following errors when building the libpatricia code:
patricia.c: In function 'Clear_Patricia':
patricia.c:377:11: error: too many arguments to function 'func'; expected 0, have 1
377 | func(Xrn->data);
| ^~~~ ~~~~~~~~~
patricia.c: In function 'patricia_process':
patricia.c:420:5: error: too many arguments to function 'func'; expected 0, have 2
420 | func(node->prefix, node->data);
| ^~~~ ~~~~~~~~~~~~
patricia.c: In function 'patricia_walk_inorder':
patricia.c:435:5: error: too many arguments to function 'func'; expected 0, have 2
435 | func(node->prefix, node->data);
| ^~~~ ~~~~~~~~~~~~
make[4]: *** [Makefile:422: patricia.lo] Error 1
Ideally, this would replaced with two function definitions: one that takes a single argument, and one that takes 2 arguments. Then update each of those libpatricia methods to take the right type of function definition for its func parameter.
Workaround: until that fix is in place, you can simply tell your compiler to use an older standard (e.g. -std=gnu17) and the problem will disappear, at the cost of not being able to take advantage of any of the other C23 capabilities.
Affected systems: Ubuntu 26.04
Recent versions of GCC (e.g. 15) enforce the C23 standard by default, which treats an empty parameter list in a function definition as explicitly meaning that the function takes no arguments.
Prior to C23, an empty parameter list was allowed to signal that the number of arguments and their types could vary.
Specifically, this issue affects the declared function definition:
typedef void (*void_fn_t)();, which is later used asfunc()with either 1 or 2 arguments, depending on the context. This causes the following errors when building the libpatricia code:Ideally, this would replaced with two function definitions: one that takes a single argument, and one that takes 2 arguments. Then update each of those libpatricia methods to take the right type of function definition for its
funcparameter.Workaround: until that fix is in place, you can simply tell your compiler to use an older standard (e.g.
-std=gnu17) and the problem will disappear, at the cost of not being able to take advantage of any of the other C23 capabilities.