Description: Fix GCC 15 build failures in the SWT GTK JNI library
 SWT 4.29 的 GTK JNI 胶水代码早于 GCC 14/15。GCC 14+ 将
 -Wincompatible-pointer-types 默认为 error，GCC 15 将函数指针强转中的空
 参数表 () 按 (void) 处理，导致 `(jlong (*)())arg0` 带参调用报
 "too many arguments"。本 patch 移除 make_linux.mak 中的 -Werror
 （相关降级旗标经 debian/rules 的 DEB_CFLAGS_MAINT_APPEND 传入），并把
 os.c/atk.c 中受影响的函数指针强转为具名首参变参形式
 `(type (*)(jlong, ...))`；XCheckIfEvent 使用精确的 Xlib 原型。
Origin: other
Forwarded: not-needed
Author: tangxiaofeng <tangxiaofeng@kylinos.cn>
Last-Update: 2026-09-05

--- swt4-gtk-4.29.0.orig/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/atk.c	
+++ swt4-gtk-4.29.0/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/atk.c	
@@ -333,7 +333,7 @@ JNIEXPORT jlong JNICALL ATK_NATIVE(call_
 {
 	jlong rc = 0;
 	ATK_NATIVE_ENTER(env, that, call__JJ_FUNC);
-	rc = (jlong)((jlong (*)())arg0)(arg1);
+	rc = (jlong)((jlong (*)(jlong, ...))arg0)(arg1);
 	ATK_NATIVE_EXIT(env, that, call__JJ_FUNC);
 	return rc;
 }
@@ -345,7 +345,7 @@ JNIEXPORT jlong JNICALL ATK_NATIVE(call_
 {
 	jlong rc = 0;
 	ATK_NATIVE_ENTER(env, that, call__JJJ_FUNC);
-	rc = (jlong)((jlong (*)())arg0)(arg1, arg2);
+	rc = (jlong)((jlong (*)(jlong, ...))arg0)(arg1, arg2);
 	ATK_NATIVE_EXIT(env, that, call__JJJ_FUNC);
 	return rc;
 }
@@ -357,7 +357,7 @@ JNIEXPORT jlong JNICALL ATK_NATIVE(call_
 {
 	jlong rc = 0;
 	ATK_NATIVE_ENTER(env, that, call__JJJJ_FUNC);
-	rc = (jlong)((jlong (*)())arg0)(arg1, arg2, arg3);
+	rc = (jlong)((jlong (*)(jlong, ...))arg0)(arg1, arg2, arg3);
 	ATK_NATIVE_EXIT(env, that, call__JJJJ_FUNC);
 	return rc;
 }
@@ -369,7 +369,7 @@ JNIEXPORT jlong JNICALL ATK_NATIVE(call_
 {
 	jlong rc = 0;
 	ATK_NATIVE_ENTER(env, that, call__JJJJJJ_FUNC);
-	rc = (jlong)((jlong (*)())arg0)(arg1, arg2, arg3, arg4, arg5);
+	rc = (jlong)((jlong (*)(jlong, ...))arg0)(arg1, arg2, arg3, arg4, arg5);
 	ATK_NATIVE_EXIT(env, that, call__JJJJJJ_FUNC);
 	return rc;
 }
--- swt4-gtk-4.29.0.orig/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/make_linux.mak	
+++ swt4-gtk-4.29.0/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/make_linux.mak	
@@ -112,9 +112,11 @@ LFLAGS += $(DEB_LDFLAGS) -shared -fPIC $
 
 NO_STRIP=1
 
-# Treat all warnings as errors. If your new code produces a warning, please
-# take time to properly understand and fix/silence it as necessary.
-CFLAGS += -Werror
+# NOTE: the upstream 'CFLAGS += -Werror' block was removed by the distro
+# build fix (fix-gcc15-build). SWT 4.29, the JNI glue code, predates modern
+# GCC (14/15): an empty parameter list in a function-pointer cast is now
+# treated as (void), so legacy casts must compile as warnings, not errors.
+# The downgrade flags are passed via DEB_CFLAGS_MAINT_APPEND in debian/rules.
 
 ifndef NO_STRIP
 	# -s = Remove all symbol table and relocation information from the executable.
--- swt4-gtk-4.29.0.orig/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c	
+++ swt4-gtk-4.29.0/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c	
@@ -10103,7 +10103,7 @@ JNIEXPORT jint JNICALL OS_NATIVE(Call__J
 {
 	jint rc = 0;
 	OS_NATIVE_ENTER(env, that, Call__JJII_FUNC);
-	rc = (jint)((jint (*)())arg0)(arg1, arg2, arg3);
+	rc = (jint)((jint (*)(jlong, ...))arg0)(arg1, arg2, arg3);
 	OS_NATIVE_EXIT(env, that, Call__JJII_FUNC);
 	return rc;
 }
@@ -10115,7 +10115,7 @@ JNIEXPORT jint JNICALL OS_NATIVE(Call__J
 {
 	jint rc = 0;
 	OS_NATIVE_ENTER(env, that, Call__JJJ_FUNC);
-	rc = (jint)((jint (*)())arg0)(arg1, arg2);
+	rc = (jint)((jint (*)(jlong, ...))arg0)(arg1, arg2);
 	OS_NATIVE_EXIT(env, that, Call__JJJ_FUNC);
 	return rc;
 }
@@ -10509,7 +10509,7 @@ JNIEXPORT jboolean JNICALL OS_NATIVE(XCh
 {
 	jboolean rc = 0;
 	OS_NATIVE_ENTER(env, that, XCheckIfEvent_FUNC);
-	rc = (jboolean)XCheckIfEvent((Display *)arg0, (XEvent *)arg1, (Bool (*)())arg2, (XPointer)arg3);
+	rc = (jboolean)XCheckIfEvent((Display *)arg0, (XEvent *)arg1, (Bool (*)(Display *, XEvent *, XPointer))arg2, (XPointer)arg3);
 	OS_NATIVE_EXIT(env, that, XCheckIfEvent_FUNC);
 	return rc;
 }
@@ -10721,7 +10721,7 @@ JNIEXPORT jlong JNICALL OS_NATIVE(call__
 {
 	jlong rc = 0;
 	OS_NATIVE_ENTER(env, that, call__JJJJJ_FUNC);
-	rc = (jlong)((jlong (*)())arg0)(arg1, arg2, arg3, arg4);
+	rc = (jlong)((jlong (*)(jlong, ...))arg0)(arg1, arg2, arg3, arg4);
 	OS_NATIVE_EXIT(env, that, call__JJJJJ_FUNC);
 	return rc;
 }
@@ -10733,7 +10733,7 @@ JNIEXPORT jlong JNICALL OS_NATIVE(call__
 {
 	jlong rc = 0;
 	OS_NATIVE_ENTER(env, that, call__JJJJJJJ_FUNC);
-	rc = (jlong)((jlong (*)())arg0)(arg1, arg2, arg3, arg4, arg5, arg6);
+	rc = (jlong)((jlong (*)(jlong, ...))arg0)(arg1, arg2, arg3, arg4, arg5, arg6);
 	OS_NATIVE_EXIT(env, that, call__JJJJJJJ_FUNC);
 	return rc;
 }
@@ -10745,7 +10745,7 @@ JNIEXPORT jlong JNICALL OS_NATIVE(call__
 {
 	jlong rc = 0;
 	OS_NATIVE_ENTER(env, that, call__JJJJJJJJ_FUNC);
-	rc = (jlong)((jlong (*)())arg0)(arg1, arg2, arg3, arg4, arg5, arg6, arg7);
+	rc = (jlong)((jlong (*)(jlong, ...))arg0)(arg1, arg2, arg3, arg4, arg5, arg6, arg7);
 	OS_NATIVE_EXIT(env, that, call__JJJJJJJJ_FUNC);
 	return rc;
 }
