Subject: error: too many arguments to function 'cproc' & AM_PROG_MKDIR_P

From: Jeffrey Cliff <[email-masked]>
Date: Fri, 10 Jan 2025 23:16:03 -0600

while compiling  both guile 3.0.10 & commit f6359a471 with

gcc (GCC) 15.0.0 20241204 (experimental)
CFLAGS="  -std=gnu23 -Oz -march=native ";
CPPFLAGS=" -D_GNU_SOURCE " ;
CXXFLAGS=" -std=gnu++23 -Os  -march=native ";
Linux fatima 6.12.5-gnugnm #1 SMP PREEMPT_DYNAMIC Wed Dec 18 01:11:56
CST 2024 x86_64 GNU/Linux
amd64

failed on :

  CC       libguile_3.0_la-boolean.lo
array-map.c: In function 'scm_ramapc':
array-map.c:200:38: error: too many arguments to function 'cproc'
  200 |           if (! (SCM_UNBNDP (data) ? cproc (va0, lva) : cproc
(va0, data, lva)))
      |                                      ^~~~~
array-map.c:200:57: error: too many arguments to function 'cproc'
  200 |           if (! (SCM_UNBNDP (data) ? cproc (va0, lva) : cproc
(va0, data, lva)))
      |                                                         ^~~~~
make[3]: *** [Makefile:3080: libguile_3.0_la-array-map.lo] Error 1
make[3]: *** Waiting for unfinished jobs....
backtrace.c: In function 'scm_init_backtrace':
backtrace.c:329:51: error: passing argument 5 of 'scm_c_define_gsubr'
from incompatible pointer type [-Wincompatible-pointer-types]
  329 |   scm_c_define_gsubr ("print-exception", 4, 0, 0, boot_print_exception);
      |                                                   ^~~~~~~~~~~~~~~~~~~~
      |                                                   |
      |                                                   struct
scm_unused_struct * (*)(struct scm_unused_struct *, struct
scm_unused_struct *, struct scm_unused_struct *, struct
scm_unused_struct *)
In file included from backtrace.c:41:
gsubr.h:72:71: note: expected 'scm_t_subr' {aka 'struct
scm_unused_struct * (*)(void)'} but argument is of type 'struct
scm_unused_struct * (*)(struct scm_unused_struct *, struct
scm_unused_struct *, struct scm_unused_struct *, struct
scm_unused_struct *)'
   72 |                                 int req, int opt, int rst,
scm_t_subr fcn);
      |
~~~~~~~~~~~^~~
make[3]: *** [Makefile:3108: libguile_3.0_la-backtrace.lo] Error 1

this is due to a semantic change in c23
https://thephd.dev/c23-is-coming-here-is-what-is-on-the-menu similar
to https://lists.gnu.org/archive/html/bug-texinfo/2024-08/msg00021.html

while troubleshooting this, using autogen on HEAD I get a warning that

configure.ac:776: warning: AM_PROG_MKDIR_P: this macro is deprecated,
and will soon be removed.
configure.ac:776: You should use the Autoconf-provided
'AC_PROG_MKDIR_P' macro instead,
configure.ac:776: and use '$(MKDIR_P)' instead of '$(mkdir_p)'in your
Makefile.am files.

jeff cliff
-- 
------------------------------------------------------------------------------------------------
End the campaign to Cancel Richard Stallman - go to stallmansupport.org !
------------------------------------------------------------------------------------------------