Summary: | x11-libs/gtk+-2.24.33-r2 - /.../gtkscale.c: error: incompatible function pointer types passing GCompareFunc (aka int ( )(const voi | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Toralf Förster <toralf> |
Component: | Current packages | Assignee: | Gentoo Linux Gnome Desktop Team <gnome> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | herrtimson, sam |
Priority: | Normal | Keywords: | PullRequest |
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
See Also: | https://github.com/gentoo/gentoo/pull/31021 | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | |||
Bug Blocks: | 870412 | ||
Attachments: |
emerge-info.txt
emerge-history.txt environment etc.clang.tar.bz2 etc.portage.tar.bz2 logs.tar.bz2 temp.tar.bz2 var.tmp.clang.tar.bz2 x11-libs:gtk+-2.24.33-r2:20221109-152137.log.bz2 function_typecast_fix.patch |
Description
Toralf Förster
2022-11-09 15:40:52 UTC
Created attachment 830115 [details]
emerge-info.txt
Created attachment 830117 [details]
emerge-history.txt
Created attachment 830119 [details]
environment
Created attachment 830121 [details]
etc.clang.tar.bz2
Created attachment 830123 [details]
etc.portage.tar.bz2
Created attachment 830125 [details]
logs.tar.bz2
Created attachment 830127 [details]
temp.tar.bz2
Created attachment 830129 [details]
var.tmp.clang.tar.bz2
Created attachment 830131 [details]
x11-libs:gtk+-2.24.33-r2:20221109-152137.log.bz2
So the problem is: > /var/tmp/portage/x11-libs/gtk+-2.24.33-r2/work/gtk+-2.24.33/gtk/gtkscale.c:1474:50: error: incompatible function pointer types passing > 'GCompareFunc' (aka 'int (*)(const void *, const void *)') to parameter of type > 'GCompareDataFunc' (aka 'int (*)(const void *, const void *, void *)') > [-Werror,-Wincompatible-function-pointer-types] compare_marks is declared as > static gint > compare_marks (gconstpointer a, gconstpointer b, gpointer data) g_slist_insert_sorted_with_data takes a GCompareDataFunc: > GSList* g_slist_insert_sorted_with_data (GSList *list, > gpointer data, > GCompareDataFunc func, > gpointer user_data) G_GNUC_WARN_UNUSED_RESULT; The problem appears to be a stray (and unnecessary) cast to GCompareFunc: > priv->marks = g_slist_insert_sorted_with_data (priv->marks, mark, > (GCompareFunc) compare_marks, > GINT_TO_POINTER ( > gtk_range_get_inverted (GTK_RANGE (scale)) > )); We can fix that easily enough, but this is not really the only problem, is it? I see * /var/tmp/portage/x11-libs/gtk+-2.24.33-r2/work/gtk+-2.24.33/gtk/gtkcellrendererspin.c:210:26: warning: assignment to 'GtkAdjustment *' {aka 'struct _GtkAdjustment *'} from incompatible pointer type 'GObject *' {aka 'struct _GObject *'} [-Wincompatible-pointer-types] * /var/tmp/portage/x11-libs/gtk+-2.24.33-r2/work/gtk+-2.24.33/gtk/gtkcomboboxtext.c:278:27: warning: assignment to 'GObject *' {aka 'struct _GObject *'} from incompatible pointer type 'GtkBuildable *' {aka 'struct _GtkBuildable *'} [-Wincompatible-pointer-types] * /var/tmp/portage/x11-libs/gtk+-2.24.33-r2/work/gtk+-2.24.33/gtk/gtkimmodule.c:665:49: warning: passing argument 3 of 'g_hash_table_lookup_extended' from incompatible pointer type [-Wincompatible-pointer-types] * /var/tmp/portage/x11-libs/gtk+-2.24.33-r2/work/gtk+-2.24.33/gtk/gtklabel.c:1339:27: warning: assignment to 'GObject *' {aka 'struct _GObject *'} from incompatible pointer type 'GtkBuildable *' {aka 'struct _GtkBuildable *'} [-Wincompatible-pointer-types] [...] * /var/tmp/portage/x11-libs/gtk+-2.24.33-r2/work/gtk+-2.24.33/gtk/gtktoolpalette.c:737:16: warning: assignment to 'GtkToolItemGroup *' {aka 'struct _GtkToolItemGroup *'} from incompatible pointer type 'GtkWidget *' {aka 'struct _GtkWidget *'} [-Wincompatible-pointer-types] * /var/tmp/portage/x11-libs/gtk+-2.24.33-r2/work/gtk+-2.24.33/gtk/gtktreeview.c:14150:37: warning: assignment to 'GtkWidget *' {aka 'struct _GtkWidget *'} from incompatible pointer type 'GtkEntry *' {aka 'struct _GtkEntry *'} [-Wincompatible-pointer-types] * /usr/include/glib-2.0/gobject/gobject.h:548:28: warning: returning 'GtkWidget *' {aka 'struct _GtkWidget *'} from a function with incompatible return type 'GObject *' {aka 'struct _GObject *'} [-Wincompatible-pointer-types] * /var/tmp/portage/x11-libs/gtk+-2.24.33-r2/work/gtk+-2.24.33/gtk/gtkwidget.c:10682:27: warning: assignment to 'GObject *' {aka 'struct _GObject *'} from incompatible pointer type 'GtkBuildable *' {aka 'struct _GtkBuildable *'} [-Wincompatible-pointer-types] * /usr/include/glib-2.0/glib/gatomic.h:131:5: warning: argument 2 of '__atomic_load' discards 'volatile' qualifier [-Wincompatible-pointer-types] * /var/tmp/portage/x11-libs/gtk+-2.24.33-r2/work/gtk+-2.24.33/modules/other/gail/gailtreeview.c:998:34: warning: assignment to 'AtkObject *' {aka 'struct _AtkObject *'} from incompatible pointer type 'GailCell *' {aka 'struct _GailCell *'} [-Wincompatible-pointer-types] * /var/tmp/portage/x11-libs/gtk+-2.24.33-r2/work/gtk+-2.24.33/modules/printbackends/cups/gtkprintbackendcups.c:3482:17: warning: assignment to 'GtkPrinterCups *' {aka 'struct _GtkPrinterCups *'} from incompatible pointer type 'GtkPrinter *' {aka 'struct _GtkPrinter *'} [-Wincompatible-pointer-types] I'd really rather not get 1 bug for each of these. I suspect we need to disable the compiler error for dead packages like gtk+:2. Note that clang makes -Wincompatible-function-pointer-types an error by default, but not -Wincompatible-pointer-types which is a superset. GCC only supports the latter warning. Created attachment 861378 [details, diff]
function_typecast_fix.patch
(In reply to nvinson234 from comment #12) > Created attachment 861378 [details, diff] [details, diff] > function_typecast_fix.patch Tried sending your patch upstream? The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d2cb27c2be5ab925ea43cdd764210dd3c55ace57 commit d2cb27c2be5ab925ea43cdd764210dd3c55ace57 Author: Matt Turner <mattst88@gentoo.org> AuthorDate: 2023-05-13 15:55:26 +0000 Commit: Matt Turner <mattst88@gentoo.org> CommitDate: 2023-05-13 15:59:20 +0000 x11-libs/gtk+: Add patch to fix casts Closes: https://bugs.gentoo.org/880617 Closes: https://github.com/gentoo/gentoo/pull/31021 Signed-off-by: Matt Turner <mattst88@gentoo.org> x11-libs/gtk+/files/gtk+-2.24.33-Fix-casts.patch | 167 +++++++++++++++++++++++ x11-libs/gtk+/gtk+-2.24.33-r2.ebuild | 2 + 2 files changed, 169 insertions(+) I fixed the problem I noted in comment #10 along with a number of other cast warnings. gtk+:2 now compiles with clang with CFLAGS="-Werror=implicit-function-declaration -Werror=implicit-int -Werror=incompatible-function-pointer-types". |