GCC 14 and clang 16 make some things that were illegal starting c99, into fatal errors by default.
For GCC 13 (and earlier) you can test this out by manually setting -Werror=implicit-function-declaration -Werror=implicit-int -Werror=int-conversion -Werror=incompatible-pointer-types
Some additional details can be found at https://wiki.gentoo.org/wiki/Modern_C_porting#FAQ
When building xsb, in config.log, the following conftest fails using Modern C settings:
configure:6888: checking whether loader understands -Wl,-export-dynamic
configure:6896: x86_64-pc-linux-gnu-gcc -o conftest -march=native -fstack-protector-all -O2 -pipe -fdiagnostics-color=always -frecord-gcc-switches -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-clash-protection -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing -Wformat -Werror=format-security -Werror=implicit-function-declaration -Werror=implicit-int -Werror=int-conversion -Werror=incompatible-pointer-types -Wno-error=format-security -fno-strict-aliasing -Wl,-export-dynamic conftest.c -lpthread -lnsl -ldl -lm >&5
conftest.c:78:1: error: return type defaults to 'int' [-Werror=implicit-int]
78 | main(){return 0;}
| ^~~~
cc1: some warnings being treated as errors
configure:6896: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
[...]
| /* end confdefs.h. */
| main(){return 0;}
configure:6904: result: no
Happens due to configure.in which contains this invalid C code:
AC_LINK_IFELSE([AC_LANG_SOURCE([[main(){return 0;}]])], __export_dynamic=yes, __export_dynamic=no)
Result: running make eventually fails due to:
-------------- Warnings/Errors --------------------
While compiling XSB/packages:
++Error[XSB]: [Runtime/C] /var/tmp/portage/dev-lang/xsb-4.0.0/work/XSB/packages/regmatch/cc/xsb_re_match.so: undefined symbol: VarStrOps
++Error[XSB/Runtime/P]: [Miscellaneous] Error in loading file /var/tmp/portage/dev-lang/xsb-4.0.0/work/XSB/packages/regmatch/cc/xsb_re_match.xwam.localhost-633
Previously reported at https://bugs.gentoo.org/870970
I hope I fixed this by changing to
It should, yes, that's the local fix I made too.
are you sure you are using the latest from the git repository? This bug was fixed exactly 2 months ago
I'm agreeing that the change from a couple months ago is a good fix, because I backported it to:
https://downloads.sourceforge.net/xsb/XSB-4-0-0.tar.gz
(with additional patches from https://dev.gentoo.org/~keri/distfiles/xsb/xsb-4.0.0-gentoo-patchset-3.tar.gz)
I haven't tried building from git, no.
Last edit: Eli Schwartz 2024-05-15