gcc 14 breaks CAN_DO in configure
According to https://gcc.gnu.org/gcc-14/porting_to.html#warnings-as-errors implicit-int and implicit-function-declaration are now errors by default.
Proposed solution:
Index: mtpaint-3.50/configure
===================================================================
--- mtpaint-3.50.orig/configure
+++ mtpaint-3.50/configure
@@ -376,8 +376,8 @@ IS_LIB()
}
CAN_DO()
{
- echo "main() { $1; }" > _conf.c
- $MT_TESTCOMP _conf.c -o _conf.tmp > /dev/null 2>&1
+ echo "int main() { $1; }" > _conf.c
+ $MT_TESTCOMP -Wno-implicit-function-declaration _conf.c -o _conf.tmp > /dev/null 2>&1
}
HAVE_FUNC()
{
Another solution:
Index: mtpaint-3.50/configure
===================================================================
--- mtpaint-3.50.orig/configure
+++ mtpaint-3.50/configure
@@ -360,7 +360,7 @@ else
"$PKG_CONFIG" "$@"
}
MT_TESTLINK="$CCLD $LDFLAGS"
- MT_TESTCOMP="$CC -fno-builtin $CPPFLAGS $LDFLAGS"
+ MT_TESTCOMP="$CC -fno-builtin -fpermissive $CPPFLAGS $LDFLAGS"
fi
if [ "$OS" != "${OS%/MSYS}" ]
Thanks for the heads-up. A proper solution will be more complex, given there are two separate MT_TESTCOMP's, and given Clang devs have a hatefest against -fpermissive.
I think the most logical in this case will be to lock down the C language version in MT_TESTCOMP with "-std=c89" , if only because this is unlikely to be the last intentional breakage those people plan on inserting.
MT_TESTCOMP="$CC -std=c89 -fno-builtin $CPPFLAGS $LDFLAGS"
Fixed in 3.50.11