On 2024-12-01, at 22:36:07 +0800, Bo YU wrote:
> Control: tags -1 patch
>
> Hi,
>
> On Fri, Nov 22, 2024 at 02:05:53PM +0100, Santiago Vila wrote:
> ...
> > x11/propwatch.c: In function ‘RebuildList’:
> > x11/propwatch.c:319:43: error: passing argument 2 of ‘XawListChange’ from incompatible pointer type [-Wincompatible-pointer-types]
> > 319 | XawListChange(bl,str_count ? str_list : &empty,
> > | ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
> > | |
> > | const char **
> > In file included from x11/propwatch.c:28:
> > /usr/include/X11/Xaw/List.h:170:26: note: expected ‘char **’ but argument is of type ‘const char **’
> > 170 | String *list,
> > | ~~~~~~~~~~~~~~~~~~~~~~~~^~~~
> > x11/propwatch.c: In function ‘ProcessPropertyChange’:
> > x11/propwatch.c:498:34: error: passing argument 2 of ‘XawListChange’ from incompatible pointer type [-Wincompatible-pointer-types]
> > 498 | XawListChange(bl,str_list,str_count,1000,1);
> > | ^~~~~~~~
> > | |
> > | const char **
>
> I have looked at this. The patch for [0] was to fix gcc-14 incompatible
> pointer issue and it worked at that time. But recently the libxaw
> upstream has some changes[1] about this, so this may lead to ftbfs again.
> Under such circumstances we can drop the patch to enable the build is
> okay.
>
> There are still some clean work that need to be done before team upload,
> so I just reply to here about the issue.
I was going to update the patch to reflect the new `XawListChange`
prototype, but as you have observed with the new prototype the upstream
code compiles again. It is, however, still fragile since it mixes
`char` pointers and `String` pointers, so I will send a new patch
upstream.
There's some fuzz in other patches, which I have fixed. Patch attached.
J.
> [0]: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1088044
> [1]: https://salsa.debian.org/xorg-team/lib/libxaw/-/commit/d0fcbd9722ad691ca0b5873c98e8e9c236fa718b
> --
> Regards,
> --
> Bo YU
>
> diff -Nru xawtv-3.107/debian/changelog xawtv-3.107/debian/changelog
> --- xawtv-3.107/debian/changelog 2024-08-15 20:06:03.000000000 +0800
> +++ xawtv-3.107/debian/changelog 2024-12-01 22:11:00.000000000 +0800
> @@ -1,3 +1,10 @@
> +xawtv (3.107-3) UNRELEASED; urgency=medium
> +
> + * Team upload.
> + * Drop incompatible-pointer-fix.patch to fix ftbfs. (Closes: #1088044)
> +
> + -- Bo YU <tsu.yubo@gmail.com> Sun, 01 Dec 2024 22:11:00 +0800
> +
> xawtv (3.107-2.1) unstable; urgency=medium
>
> * Non-maintainer upload.
> diff -Nru xawtv-3.107/debian/patches/incompatible-pointer-fix.patch xawtv-3.107/debian/patches/incompatible-pointer-fix.patch
> --- xawtv-3.107/debian/patches/incompatible-pointer-fix.patch 2024-08-15 20:06:03.000000000 +0800
> +++ xawtv-3.107/debian/patches/incompatible-pointer-fix.patch 1970-01-01 07:30:00.000000000 +0730
> @@ -1,62 +0,0 @@
> -Author: Jeremy Sowden <azazel@debian.org>
> -Last-Update: 2024-08-15
> -Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1075650
> -Forwarded: https://lore.kernel.org/linux-media/20240815115415.3371544-2-jeremy@azazel.net/
> -Description: fix gcc-14 FTBFS caused by incompatible pointer types
> - `XawListChange` declares the type of its second parameter as `_Xconst
> - char **`. However, xawtv passes `str_list`, which is declared as
> - `String *`, or `&empty` which is declared as `char *`. With gcc 14,
> - these result in incompatible-pointer errors:
> - .
> - x11/propwatch.c: In function 'RebuildList':
> - x11/propwatch.c:319:43: error: passing argument 2 of 'XawListChange' from incompatible pointer type [-Wincompatible-pointer-types]
> - 319 | XawListChange(bl,str_count ? str_list : &empty,
> - | ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
> - | |
> - | char **
> - In file included from x11/propwatch.c:28:
> - /usr/include/X11/Xaw/List.h:170:27: note: expected 'const char **' but argument is of type 'char **'
> - 170 | _Xconst char **list,
> - | ^
> - x11/propwatch.c: In function 'ProcessPropertyChange':
> - x11/propwatch.c:498:34: error: passing argument 2 of 'XawListChange' from incompatible pointer type [-Wincompatible-pointer-types]
> - 498 | XawListChange(bl,str_list,str_count,1000,1);
> - | ^~~~~~~~
> - | |
> - | char **
> - /usr/include/X11/Xaw/List.h:170:27: note: expected 'const char **' but argument is of type 'char **'
> - 170 | _Xconst char **list,
> - | ^
> - .
> - Both variables are only used as arguments to `XawListChange`, so change
> - their types to match its expectations.
> -
> ---- a/x11/propwatch.c
> -+++ b/x11/propwatch.c
> -@@ -58,8 +58,8 @@
> - "WM_COMMAND",
> - };
> -
> --static String *str_list;
> --static int str_count;
> -+static const char **str_list;
> -+static int str_count;
> -
> - static void AddWatch(Display *dpy, Window win, int i);
> - static void DeleteWatch(Window win);
> -@@ -306,13 +306,13 @@
> - static void
> - RebuildList(void)
> - {
> -- static char *empty = "empty";
> -+ static const char *empty = "empty";
> - int i;
> - struct WATCHLIST *this;
> -
> - if (str_list)
> - free(str_list);
> -- str_list = malloc(str_count*sizeof(String));
> -+ str_list = malloc(str_count*sizeof(*str_list));
> - for (i=0, this=watchlist; this!=NULL; i++, this=this->next)
> - str_list[i] = this->text;
> - qsort(str_list,str_count,sizeof(char*),cmp);
> diff -Nru xawtv-3.107/debian/patches/series xawtv-3.107/debian/patches/series
> --- xawtv-3.107/debian/patches/series 2024-08-15 20:06:03.000000000 +0800
> +++ xawtv-3.107/debian/patches/series 2024-12-01 22:11:00.000000000 +0800
> @@ -8,4 +8,3 @@
> 0008-Makefile.in-honour-CPPFLAGS.patch
> CVE-2020-13696-error_message_fix.patch
> 0001-Replace-sys_siglist-with-strsignal.patch
> -incompatible-pointer-fix.patch
From 0580e62325f3ab5c305df3f1916332dcd753c11b Mon Sep 17 00:00:00 2001
From: Jeremy Sowden <azazel@debian.org>
Date: Sun, 1 Dec 2024 11:46:50 +0000
Subject: [PATCH] d/patches: fix some fuzz
Signed-off-by: Jeremy Sowden <azazel@debian.org>
---
.../patches/0001-Replace-sys_siglist-with-strsignal.patch | 2 +-
debian/patches/minor_spelling_change.diff | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/debian/patches/0001-Replace-sys_siglist-with-strsignal.patch b/debian/patches/0001-Replace-sys_siglist-with-strsignal.patch
index 7c09c80f08d3..62f745aef1f8 100644
--- a/debian/patches/0001-Replace-sys_siglist-with-strsignal.patch
+++ b/debian/patches/0001-Replace-sys_siglist-with-strsignal.patch
@@ -50,7 +50,7 @@ index 60a840641e33..4bf458b227a0 100644
}
static void usage(FILE *fp)
-@@ -422,7 +422,7 @@ main(int argc, char *argv[])
+@@ -426,7 +426,7 @@ main(int argc, char *argv[])
}
if (verbose && termsig)
fprintf(stderr,"exiting on signal %d [%s]\n",
diff --git a/debian/patches/minor_spelling_change.diff b/debian/patches/minor_spelling_change.diff
index e83ef692a2e7..c536be0cdb90 100644
--- a/debian/patches/minor_spelling_change.diff
+++ b/debian/patches/minor_spelling_change.diff
@@ -84,7 +84,7 @@ diff --git a/console/scantv.c b/console/scantv.c
index 931e707..6c7cce8 100644
--- a/console/scantv.c
+++ b/console/scantv.c
-@@ -273,7 +273,7 @@ main(int argc, char **argv)
+@@ -272,7 +272,7 @@ main(int argc, char **argv)
}
} else {
/* scan freqnencies */
@@ -125,7 +125,7 @@ diff --git a/console/v4l-conf.c b/console/v4l-conf.c
index c38bf16..5686f57 100644
--- a/console/v4l-conf.c
+++ b/console/v4l-conf.c
-@@ -409,7 +409,7 @@ displayinfo_v4l2(int fd, struct DISPLAYINFO *d)
+@@ -412,7 +412,7 @@ displayinfo_v4l2(int fd, struct DISPLAYINFO *d)
if (EPERM == errno && 0 != geteuid())
fprintf(stderr,
"v4l-conf: You should install me suid root, I need\n"
@@ -376,7 +376,7 @@ diff --git a/x11/xawtv.c b/x11/xawtv.c
index b87f53e..59c53c3 100644
--- a/x11/xawtv.c
+++ b/x11/xawtv.c
-@@ -1680,18 +1680,18 @@ main(int argc, char *argv[])
+@@ -1678,18 +1678,18 @@ main(int argc, char *argv[])
sizeof(actionTable)/sizeof(XtActionsRec));
x11_misc_init(dpy);
if (debug)
--
2.45.2
Attachment:
signature.asc
Description: PGP signature