Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build error with gcc14 -Werror=incompatible-pointer-types #100

Open
mtasaka opened this issue Mar 1, 2024 · 0 comments · May be fixed by #101
Open

build error with gcc14 -Werror=incompatible-pointer-types #100

mtasaka opened this issue Mar 1, 2024 · 0 comments · May be fixed by #101

Comments

@mtasaka
Copy link
Contributor

mtasaka commented Mar 1, 2024

Upcoming gcc14 now defaults to -Werror=incompatible-pointer-types , and compiling libfm git head with gcc14 produces the following errors:

/buildroot/libfm-1.3.2/_BUILDDIR_gtk2/../src/gtk/exo/exo-icon-view.c: In function ‘exo_icon_view_key_press_event’:
/buildroot/libfm-1.3.2/_BUILDDIR_gtk2/../src/gtk/exo/exo-icon-view.c:2822:25: error: assignment to ‘GdkWindow *’ {aka ‘struct _GdkDrawable *’} from incompatible pointer type ‘GObject *’ {aka ‘struct _GObject *’} [-Werror=incompatible-pointer-types]
 2822 |   new_event->key.window = g_object_ref (G_OBJECT (gtk_widget_get_window (icon_view->priv->search_entry)));
      |                         ^
/buildroot/libfm-1.3.2/_BUILDDIR_gtk2/../src/gtk/exo/exo-icon-view.c: In function ‘exo_icon_view_rows_reordered’:
/buildroot/libfm-1.3.2/_BUILDDIR_gtk2/../src/gtk/exo/exo-icon-view.c:4608:38: warning: ‘*list_array’ may be used uninitialized [-Wmaybe-uninitialized]
 4608 |   icon_view->priv->items = list_array[0];
      |                            ~~~~~~~~~~^~~

/buildroot/libfm-1.3.2/_BUILDDIR_gtk2/../src/gtk/fm-dnd-dest.c: In function ‘_ask_action_on_drop’:
/buildroot/libfm-1.3.2/_BUILDDIR_gtk2/../src/gtk/fm-dnd-dest.c:461:13: error: assignment to ‘GtkMenu *’ {aka ‘struct _GtkMenu *’} from incompatible pointer type ‘GtkWidget *’ {aka ‘struct _GtkWidget *’} [-Werror=incompatible-pointer-types]
  461 |     ri.menu = g_object_ref(gtk_ui_manager_get_widget(ui, "/popup"));
      |             ^


/buildroot/libfm-1.3.2/_BUILDDIR_gtk2/../src/gtk/fm-standard-view.c: In function ‘create_icon_view’:
/buildroot/libfm-1.3.2/_BUILDDIR_gtk2/../src/gtk/fm-standard-view.c:640:23: error: assignment to ‘FmCellRendererText *’ {aka ‘struct _FmCellRendererText *’} from incompatible pointer type ‘GtkCellRenderer *’ {aka ‘struct _GtkCellRenderer *’} [-Werror=incompatible-pointer-types]
  640 |     fv->renderer_text = g_object_ref_sink(render);
      |                       ^
mtasaka added a commit to mtasaka/libfm that referenced this issue Mar 1, 2024
gcc14 now defaults to -Werror=incompatible-pointer-types .
To support this, cast GTK related objects for assignment
properly.

Fixes lxde#100 .
@mtasaka mtasaka linked a pull request Mar 1, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant