Outdated m4/R.m4 causes issues with Clang 16
Brought to you by:
martyn_plummer
Clang 16 (soon to be released) makes -Wimplicit-function-declaration and -Wimplicit-int error by default.
The copy of R.m4 (in m4/R.m4) distributed with jags is quite out of date. Going by the copyright header, it's from 2005(!)
Syncing with the copy distributed with R should fix an issue in the isfinite()
check:
configure:21871: checking for working isfinite
configure:21893: x86_64-pc-linux-gnu-gcc -o conftest -O2 -pipe -march=native -fdiagnostics-color=always -frecord-gcc-switches -Wreturn-type -ggdb3 -Werror=implicit-function-declaration -Werror=implicit-int -Wl,-O1 -Wl,--as-needed -Wl,--defsym=__gentoo_check_ldflags__=0 -Wl,-z,pack-relative-relocs conftest.c >&5
conftest.c: In function 'main':
conftest.c:64:3: error: implicit declaration of function 'exit' [-Werror=implicit-function-declaration]
64 | exit(isfinite(1./0.) | isfinite(0./0.) | isfinite(-1./0.));
| ^~~~
conftest.c:62:1: note: include '<stdlib.h>' or provide a declaration of 'exit'
61 | #include "confdefs.h"
+++ |+#include <stdlib.h>
62 | int main () {
conftest.c:64:3: warning: incompatible implicit declaration of built-in function 'exit' [-Wbuiltin-declaration-mismatch]
64 | exit(isfinite(1./0.) | isfinite(0./0.) | isfinite(-1./0.));
| ^~~~
conftest.c:64:3: note: include '<stdlib.h>' or provide a declaration of 'exit'
cc1: some warnings being treated as errors
configure:21893: $? = 1
configure: program exited with status 1
configure: failed program was:
Thanks.
Anonymous