elementary / granite

Library that extends GTK with common widgets and utilities
https://elementary.io
GNU Lesser General Public License v3.0
289 stars 60 forks source link

Build fails with gcc 14.x #687

Closed kloczek closed 4 months ago

kloczek commented 10 months ago

What Happened?

Looks like last version (7.4.0) build fails with latest gcc 14.x which is now used in fedora rawhide.

Steps to Reproduce

Build using gcc 14.

Expected Behavior

Build should not fail.

OS Version

7.x (Horus)

Software Version

Latest release (I have run all updates)

Log Output

Build fails with ``` [tkloczko@pers-jacek x86_64-redhat-linux-gnu]$ ninja -k 0 [1/13] Compiling C object lib/libgranite-7.so.7.4.0.p/meson-generated_Widgets_Dialog.c.o FAILED: lib/libgranite-7.so.7.4.0.p/meson-generated_Widgets_Dialog.c.o /usr/bin/gcc -Ilib/libgranite-7.so.7.4.0.p -Ilib -I../lib -Ilib/Icons -Ilib/Styles -I/usr/include/gee-0.8 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/gio-unix-2.0 -I/usr/include/gtk-4.0 -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/cairo -I/usr/include/graphene-1.0 -I/usr/lib64/graphene-1.0/include -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -w '-DGETTEXT_PACKAGE="granite"' -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -O2 -g -grecord-gcc-switches -pipe -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fdata-sections -ffunction-sections -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -flto=auto -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -Wall -Werror=format-security -Os -fPIC -mfpmath=sse -msse -msse2 -MD -MQ lib/libgranite-7.so.7.4.0.p/meson-generated_Widgets_Dialog.c.o -MF lib/libgranite-7.so.7.4.0.p/meson-generated_Widgets_Dialog.c.o.d -o lib/libgranite-7.so.7.4.0.p/meson-generated_Widgets_Dialog.c.o -c lib/libgranite-7.so.7.4.0.p/Widgets/Dialog.c ../lib/Widgets/Dialog.vala: In function ‘granite_dialog_constructor’: ../lib/Widgets/Dialog.vala:75:9: error: assignment to ‘GtkBox *’ {aka ‘struct _GtkBox *’} from incompatible pointer type ‘GtkWidget *’ {aka ‘struct _GtkWidget *’} [-Wincompatible-pointer-types] 75 | var content_area = get_content_area (); | ^ [2/13] Compiling C object demo/granite-7-demo.p/meson-generated_Views_AccelLabelView.c.o FAILED: demo/granite-7-demo.p/meson-generated_Views_AccelLabelView.c.o /usr/bin/gcc -Idemo/granite-7-demo.p -Idemo -I../demo -Ilib -I../lib -I/usr/include/gee-0.8 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/gio-unix-2.0 -I/usr/include/gtk-4.0 -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/cairo -I/usr/include/graphene-1.0 -I/usr/lib64/graphene-1.0/include -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -w '-DGETTEXT_PACKAGE="granite"' -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -O2 -g -grecord-gcc-switches -pipe -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fdata-sections -ffunction-sections -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -flto=auto -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -Wall -Werror=format-security -Os -mfpmath=sse -msse -msse2 -MD -MQ demo/granite-7-demo.p/meson-generated_Views_AccelLabelView.c.o -MF demo/granite-7-demo.p/meson-generated_Views_AccelLabelView.c.o.d -o demo/granite-7-demo.p/meson-generated_Views_AccelLabelView.c.o -c demo/granite-7-demo.p/Views/AccelLabelView.c ../demo/Views/AccelLabelView.vala: In function ‘accel_label_view_constructor’: ../demo/Views/AccelLabelView.vala:35:40: error: passing argument 2 of ‘gtk_menu_button_set_popover’ from incompatible pointer type [-Wincompatible-pointer-types] 35 | popover_button.popover = popover; | ^~ | | | GtkPopover * {aka struct _GtkPopover *} In file included from /usr/include/gtk-4.0/gtk/gtk.h:189, from demo/granite-7-demo.p/Views/AccelLabelView.c:9: /usr/include/gtk-4.0/gtk/gtkmenubutton.h:60:61: note: expected ‘GtkWidget *’ {aka ‘struct _GtkWidget *’} but argument is of type ‘GtkPopover *’ {aka ‘struct _GtkPopover *’} 60 | GtkWidget *popover); | ~~~~~~~~~~~~~~~^~~~~~~ [3/13] Compiling C object demo/granite-7-demo.p/meson-generated_Views_ModeButtonView.c.o FAILED: demo/granite-7-demo.p/meson-generated_Views_ModeButtonView.c.o /usr/bin/gcc -Idemo/granite-7-demo.p -Idemo -I../demo -Ilib -I../lib -I/usr/include/gee-0.8 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/gio-unix-2.0 -I/usr/include/gtk-4.0 -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/cairo -I/usr/include/graphene-1.0 -I/usr/lib64/graphene-1.0/include -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -w '-DGETTEXT_PACKAGE="granite"' -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -O2 -g -grecord-gcc-switches -pipe -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fdata-sections -ffunction-sections -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -flto=auto -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -Wall -Werror=format-security -Os -mfpmath=sse -msse -msse2 -MD -MQ demo/granite-7-demo.p/meson-generated_Views_ModeButtonView.c.o -MF demo/granite-7-demo.p/meson-generated_Views_ModeButtonView.c.o.d -o demo/granite-7-demo.p/meson-generated_Views_ModeButtonView.c.o -c demo/granite-7-demo.p/Views/ModeButtonView.c ../demo/Views/ModeButtonView.vala: In function ‘mode_button_view_constructor’: ../demo/Views/ModeButtonView.vala:53:40: error: passing argument 2 of ‘gtk_menu_button_set_popover’ from incompatible pointer type [-Wincompatible-pointer-types] 53 | popover_button.popover = switchbutton_popover; | ^~~~~~~ | | | GtkPopover * {aka struct _GtkPopover *} In file included from /usr/include/gtk-4.0/gtk/gtk.h:189, from demo/granite-7-demo.p/Views/ModeButtonView.c:9: /usr/include/gtk-4.0/gtk/gtkmenubutton.h:60:61: note: expected ‘GtkWidget *’ {aka ‘struct _GtkWidget *’} but argument is of type ‘GtkPopover *’ {aka ‘struct _GtkPopover *’} 60 | GtkWidget *popover); | ~~~~~~~~~~~~~~~^~~~~~~ [4/13] Compiling C object demo/granite-7-demo.p/meson-generated_Views_DialogsView.c.o FAILED: demo/granite-7-demo.p/meson-generated_Views_DialogsView.c.o /usr/bin/gcc -Idemo/granite-7-demo.p -Idemo -I../demo -Ilib -I../lib -I/usr/include/gee-0.8 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/gio-unix-2.0 -I/usr/include/gtk-4.0 -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/cairo -I/usr/include/graphene-1.0 -I/usr/lib64/graphene-1.0/include -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -w '-DGETTEXT_PACKAGE="granite"' -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -O2 -g -grecord-gcc-switches -pipe -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fdata-sections -ffunction-sections -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -flto=auto -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -Wall -Werror=format-security -Os -mfpmath=sse -msse -msse2 -MD -MQ demo/granite-7-demo.p/meson-generated_Views_DialogsView.c.o -MF demo/granite-7-demo.p/meson-generated_Views_DialogsView.c.o.d -o demo/granite-7-demo.p/meson-generated_Views_DialogsView.c.o -c demo/granite-7-demo.p/Views/DialogsView.c ../demo/Views/DialogsView.vala: In function ‘dialogs_view_show_dialog’: ../demo/Views/DialogsView.vala:60:9: error: assignment to ‘GtkBox *’ {aka ‘struct _GtkBox *’} from incompatible pointer type ‘GtkWidget *’ {aka ‘struct _GtkWidget *’} [-Wincompatible-pointer-types] 60 | dialog.get_content_area ().append (layout); | ^ [5/13] Compiling C object lib/libgranite-7.so.7.4.0.p/meson-generated_Widgets_MessageDialog.c.o FAILED: lib/libgranite-7.so.7.4.0.p/meson-generated_Widgets_MessageDialog.c.o /usr/bin/gcc -Ilib/libgranite-7.so.7.4.0.p -Ilib -I../lib -Ilib/Icons -Ilib/Styles -I/usr/include/gee-0.8 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/gio-unix-2.0 -I/usr/include/gtk-4.0 -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/cairo -I/usr/include/graphene-1.0 -I/usr/lib64/graphene-1.0/include -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -w '-DGETTEXT_PACKAGE="granite"' -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -O2 -g -grecord-gcc-switches -pipe -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fdata-sections -ffunction-sections -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -flto=auto -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -Wall -Werror=format-security -Os -fPIC -mfpmath=sse -msse -msse2 -MD -MQ lib/libgranite-7.so.7.4.0.p/meson-generated_Widgets_MessageDialog.c.o -MF lib/libgranite-7.so.7.4.0.p/meson-generated_Widgets_MessageDialog.c.o.d -o lib/libgranite-7.so.7.4.0.p/meson-generated_Widgets_MessageDialog.c.o -c lib/libgranite-7.so.7.4.0.p/Widgets/MessageDialog.c ../lib/Widgets/MessageDialog.vala: In function ‘granite_message_dialog_constructor’: ../lib/Widgets/MessageDialog.vala:291:10: error: assignment to ‘GtkBox *’ {aka ‘struct _GtkBox *’} from incompatible pointer type ‘GtkWidget *’ {aka ‘struct _GtkWidget *’} [-Wincompatible-pointer-types] 291 | get_content_area ().append (message_grid); | ^ [6/13] Compiling C object lib/libgranite-7.so.7.4.0.p/meson-generated_Widgets_HyperTextView.c.o FAILED: lib/libgranite-7.so.7.4.0.p/meson-generated_Widgets_HyperTextView.c.o /usr/bin/gcc -Ilib/libgranite-7.so.7.4.0.p -Ilib -I../lib -Ilib/Icons -Ilib/Styles -I/usr/include/gee-0.8 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/gio-unix-2.0 -I/usr/include/gtk-4.0 -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/cairo -I/usr/include/graphene-1.0 -I/usr/lib64/graphene-1.0/include -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -w '-DGETTEXT_PACKAGE="granite"' -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -O2 -g -grecord-gcc-switches -pipe -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fdata-sections -ffunction-sections -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -flto=auto -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -Wall -Werror=format-security -Os -fPIC -mfpmath=sse -msse -msse2 -MD -MQ lib/libgranite-7.so.7.4.0.p/meson-generated_Widgets_HyperTextView.c.o -MF lib/libgranite-7.so.7.4.0.p/meson-generated_Widgets_HyperTextView.c.o.d -o lib/libgranite-7.so.7.4.0.p/meson-generated_Widgets_HyperTextView.c.o -c lib/libgranite-7.so.7.4.0.p/Widgets/HyperTextView.c glib-2.0.vapi: In function ‘_vala_g_hash_table_take’: glib-2.0.vapi:5609:6: error: assignment to ‘void **’ from incompatible pointer type ‘GHashTable **’ {aka ‘struct _GHashTable **’} [-Wincompatible-pointer-types] [7/13] Compiling C object lib/libgranite-7.so.7.4.0.p/meson-generated_Services_ContractorProxy.c.o FAILED: lib/libgranite-7.so.7.4.0.p/meson-generated_Services_ContractorProxy.c.o /usr/bin/gcc -Ilib/libgranite-7.so.7.4.0.p -Ilib -I../lib -Ilib/Icons -Ilib/Styles -I/usr/include/gee-0.8 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/gio-unix-2.0 -I/usr/include/gtk-4.0 -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/cairo -I/usr/include/graphene-1.0 -I/usr/lib64/graphene-1.0/include -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -w '-DGETTEXT_PACKAGE="granite"' -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -O2 -g -grecord-gcc-switches -pipe -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fdata-sections -ffunction-sections -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -flto=auto -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -Wall -Werror=format-security -Os -fPIC -mfpmath=sse -msse -msse2 -MD -MQ lib/libgranite-7.so.7.4.0.p/meson-generated_Services_ContractorProxy.c.o -MF lib/libgranite-7.so.7.4.0.p/meson-generated_Services_ContractorProxy.c.o.d -o lib/libgranite-7.so.7.4.0.p/meson-generated_Services_ContractorProxy.c.o -c lib/libgranite-7.so.7.4.0.p/Services/ContractorProxy.c ../lib/Services/ContractorProxy.vala: In function ‘granite_services_contractor_proxy_get_contracts_for_files’: ../lib/Services/ContractorProxy.vala:299:10: error: assignment to ‘gchar **’ {aka ‘char **’} from incompatible pointer type ‘void **’ [-Wincompatible-pointer-types] 299 | return get_contracts_by_mimelist (mime_types.to_array ()); | ^ ninja: build stopped: cannot make progress due to previous errors. ```

Hardware Info

No response

ryonakano commented 6 months ago

I tried building 7.4.0 on Fedora 40 which comes with gcc 14.0.1, but building succeeded. Many warnings are printed though.

user@fedora:~/work/granite$ valac --version
Vala 0.56.17
user@fedora:~/work/granite$ gcc --version
gcc (GCC) 14.0.1 20240411 (Red Hat 14.0.1-0)
Copyright (C) 2024 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

user@fedora:~/work/granite$ ninja --version
1.11.1
user@fedora:~/work/granite$ meson --version
1.4.0
user@fedora:~/work/granite$ 
tintou commented 6 months ago

I think that the issue has been fixed with recent Vala version.

ryonakano commented 4 months ago

Closing because this does not occur in the latest Fedora 40. Feel free to reopen if it persists.