0

I got the error when compiling lightdm-gtk-greeter-2.0.3.tar.gz as below

make[2]: Leaving directory '/sources/lightdm-1.24.0/lightdm-gtk-greeter-2.0.3/po'
Making all in src
make[2]: Entering directory '/sources/lightdm-1.24.0/lightdm-gtk-greeter-2.0.3/src'
make  all-am
make[3]: Entering directory '/sources/lightdm-1.24.0/lightdm-gtk-greeter-2.0.3/src'
  CC       lightdm_gtk_greeter-lightdm-gtk-greeter.o
lightdm-gtk-greeter.c: In function ‘sigterm_cb’:
lightdm-gtk-greeter.c:447:41: error: cast between incompatible function types from ‘void (*)(GPid,  gboolean)’ {aka ‘void (*)(int,  int)’} to ‘void (*)(void *, void *)’ [-Werror=cast-function-type]
         g_slist_foreach (pids_to_close, (GFunc)close_pid, GINT_TO_POINTER (FALSE));
                                         ^
lightdm-gtk-greeter.c: In function ‘menu_command_run’:
lightdm-gtk-greeter.c:927:77: error: cast between incompatible function types from ‘void (*)(GtkWidget *)’ {aka ‘void (*)(struct _GtkWidget *)’} to ‘void (*)(GtkWidget *, void *)’ {aka ‘void (*)(struct _GtkWidget *, void *)’} [-Werror=cast-function-type]
                     gtk_container_foreach (GTK_CONTAINER (command->widget), (GtkCallback)gtk_widget_destroy, NULL);
                                                                             ^
lightdm-gtk-greeter.c: In function ‘reassign_menu_item_accel’:
lightdm-gtk-greeter.c:1489:57: error: cast between incompatible function types from ‘void (*)(GtkWidget *)’ {aka ‘void (*)(struct _GtkWidget *)’} to ‘void (*)(GtkWidget *, void *)’ {aka ‘void (*)(struct _GtkWidget *, void *)’} [-Werror=cast-function-type]
         gtk_container_foreach (GTK_CONTAINER (submenu), (GtkCallback)reassign_menu_item_accel, NULL);
                                                         ^
lightdm-gtk-greeter.c: In function ‘main’:
lightdm-gtk-greeter.c:2756:33: error: cast between incompatible function types from ‘void (*)(void *)’ to ‘gboolean (*)(void *)’ {aka ‘int (*)(void *)’} [-Werror=cast-function-type]
     g_unix_signal_add (SIGTERM, (GSourceFunc)sigterm_cb, /* is_callback */ GINT_TO_POINTER (TRUE));
                                 ^
lightdm-gtk-greeter.c:3152:40: error: cast between incompatible function types from ‘gboolean (*)(void)’ {aka ‘int (*)(void)’} to ‘gboolean (*)(void *)’ {aka ‘int (*)(void *)’} [-Werror=cast-function-typ]
         gdk_threads_add_timeout (1000, (GSourceFunc) clock_timeout_thread, NULL);
                                        ^
cc1: all warnings being treated as errors
make[3]: *** [Makefile:536: lightdm_gtk_greeter-lightdm-gtk-greeter.o] Error 1
make[3]: Leaving directory '/sources/lightdm-1.24.0/lightdm-gtk-greeter-2.0.3/src'
make[2]: *** [Makefile:415: all] Error 2
make[2]: Leaving directory '/sources/lightdm-1.24.0/lightdm-gtk-greeter-2.0.3/src'
make[1]: *** [Makefile:452: all-recursive] Error 1
make[1]: Leaving directory '/sources/lightdm-1.24.0/lightdm-gtk-greeter-2.0.3'
make: *** [Makefile:384: all] Error 2

I am using glibc-2.28 and gcc-8.2.0. Could anyone help?

Thanks

Employed Russian
  • 199,314
  • 34
  • 295
  • 362
xuanloctn
  • 81
  • 1
  • 1
  • 8
  • I would probably remove `-Werror` form `CFLAGS`. You should also file a bug report against LightDM. They need to fix their casts if they want to use `-Werror`. – jww Jul 14 '19 at 17:21
  • @jww or maybe the OP is trying to build lightdm-gtk-greeter against unsupported (too new or too old) gtk and glib (sic; not glib**c**) libraries? –  Jul 14 '19 at 20:51
  • @mosvy - I'm unconvinced. I help maintain several open source projects. People expect things to just work. They don't want excuses. In fact, two of the projects I work with still tests against Fedora 1 with GCC 3. There's no such thing as too old when you are the guy who needs something on a legacy system. (Or maybe I should say, I don't buy into the abandon-ware model of software development). – jww Jul 14 '19 at 20:59
  • I am perfectly convinced that *may* be the case. I once had to compile a different lightdm-gtk-greeter version by hand (because the current version was not able to combine autologin + stop and login manually on key press, and fixing it turned out to be horribly complicated). I ran into exactly the same kind of errors -- unfortunately I didn't keep a log, or I would've been able to help the OP. –  Jul 14 '19 at 21:13
  • OUR_CFLAGS="-Wno-declaration-after-statement \ -Wno-error=deprecated-declarations" CFLAGS="$CFLAGS $OUR_CFLAGS" \ HAVE_EXO_CSOURCE=yes \ ./configure \ --prefix=/usr \ --libexecdir=/usr/lib/lightdm \ --sbindir=/usr/bin \ --sysconfdir=/etc \ --with-libxklavier \ --enable-kill-on-sigterm \ --disable-libido \ --disable-libindicator \ --disable-static \ --docdir=/usr/share/doc/lightdm-gtk-greeter-2.0.3 && make – xuanloctn Jul 15 '19 at 02:57
  • Above is my configure No -Werror was specified – xuanloctn Jul 15 '19 at 02:57

0 Answers0