mtPaint icon indicating copy to clipboard operation
mtPaint copied to clipboard

gcc 14 breaks CAN_DO in configure

Open etam opened this issue 1 year ago • 2 comments

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()
 {

etam avatar Sep 16 '24 20:09 etam

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}" ]

etam avatar Sep 17 '24 06:09 etam

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"

wjaguar avatar Sep 18 '24 14:09 wjaguar

Fixed in 3.50.11

wjaguar avatar Nov 08 '24 00:11 wjaguar