elementary / elementary/calculator

2.0.3: is not gcc 14.x ready

Open
#270 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Vala
Stars
83
Forks
32
Avg merge
2d 3h
Merged PRs (30d)
3

Description

### What Happened?

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

Build fails with

```console
[tkloczko@pers-jacek x86_64-redhat-linux-gnu]$ ninja -k 0
[1/4] Compiling C object src/io.elementary.calculator.p/meson-generated_HistoryDialog.c.o
FAILED: src/io.elementary.calculator.p/meson-generated_HistoryDialog.c.o
/usr/bin/gcc -Isrc/io.elementary.calculator.p -Isrc -I../src -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -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 -I/usr/include/granite-7 -I/usr/include/gee-0.8 -I/usr/include/gio-unix-2.0 -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -w '-DGETTEXT_PACKAGE="io.elementary.calculator"' -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 -mfpmath=sse -msse -msse2 -MD -MQ src/io.elementary.calculator.p/meson-generated_HistoryDialog.c.o -MF src/io.elementary.calculator.p/meson-generated_HistoryDialog.c.o.d -o src/io.elementary.calculator.p/meson-generated_HistoryDialog.c.o -c src/io.elementary.calculator.p/HistoryDialog.c
../src/HistoryDialog.vala: In function ‘pantheon_calculator_history_dialog_constructor’:
../src/HistoryDialog.vala:110:10: error: assignment to ‘GtkBox *’ {aka ‘struct _GtkBox *’} from incompatible pointer type ‘GtkWidget *’ {aka ‘struct _GtkWidget *’} [-Wincompatible-pointer-types]
110 | get_content_area ().append (main_grid);
| ^
[2/4] Compiling C object src/io.elementary.calculator.p/meson-generated_Application.c.o
FAILED: src/io.elementary.calculator.p/meson-generated_Application.c.o
/usr/bin/gcc -Isrc/io.elementary.calculator.p -Isrc -I../src -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -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 -I/usr/include/granite-7 -I/usr/include/gee-0.8 -I/usr/include/gio-unix-2.0 -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -w '-DGETTEXT_PACKAGE="io.elementary.calculator"' -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 -mfpmath=sse -msse -msse2 -MD -MQ src/io.elementary.calculator.p/meson-generated_Application.c.o -MF src/io.elementary.calculator.p/meson-generated_Application.c.o.d -o src/io.elementary.calculator.p/meson-generated_Application.c.o -c src/io.elementary.calculator.p/Application.c
../src/Application.vala: In function ‘pantheon_calculator_application_real_startup’:
../src/Application.vala:54:77: error: passing argument 3 of ‘gtk_application_set_accels_for_action’ from incompatible pointer type [-Wincompatible-pointer-types]
54 | set_accels_for_action ("app.quit", {"q"});
| ^
| |
| gchar ** {aka char **}
In file included from /usr/include/gtk-4.0/gtk/gtkwindow.h:32,
from /usr/include/gtk-4.0/gtk/gtkaboutdialog.h:29,
from /usr/include/gtk-4.0/gtk/gtk.h:33,
from src/io.elementary.calculator.p/Application.c:24:
/usr/include/gtk-4.0/gtk/gtkapplication.h:131:88: note: expected ‘const char * const*’ but argument is of type ‘gchar **’ {aka ‘char **’}
131 | const char * const *accels);
| ~~~~~~~~~~~~~~~~~~~~~^~~~~~
[3/4] Compiling C object src/io.elementary.calculator.p/meson-generated_MainWindow.c.o
FAILED: src/io.elementary.calculator.p/meson-generated_MainWindow.c.o
/usr/bin/gcc -Isrc/io.elementary.calculator.p -Isrc -I../src -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -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 -I/usr/include/granite-7 -I/usr/include/gee-0.8 -I/usr/include/gio-unix-2.0 -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -w '-DGETTEXT_PACKAGE="io.elementary.calculator"' -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 -mfpmath=sse -msse -msse2 -MD -MQ src/io.elementary.calculator.p/meson-generated_MainWindow.c.o -MF src/io.elementary.calculator.p/meson-generated_MainWindow.c.o.d -o src/io.elementary.calculator.p/meson-generated_MainWindow.c.o -c src/io.elementary.calculator.p/MainWindow.c
../src/MainWindow.vala: In function ‘pantheon_calculator_main_window_button_gt_clicked’:
../src/MainWindow.vala:710:26: error: passing argument 2 of ‘g_list_foreach’ from incompatible pointer type [-Wincompatible-pointer-types]
710 | history.foreach ((list_entry) => {
| ^~~~~~~~~~~~~~~~~
| |
| void (*)(const void *, void *)
In file included from /usr/include/glib-2.0/glib/ghash.h:36,
from /usr/include/glib-2.0/glib.h:52,
from /usr/include/gtk-4.0/gtk/css/gtkcss.h:29,
from /usr/include/gtk-4.0/gtk/gtk.h:29,
from src/io.elementary.calculator.p/MainWindow.c:24:
/usr/include/glib-2.0/glib/glist.h:139:60: note: expected ‘GFunc’ {aka ‘void (*)(void *, void *)’} but argument is of type ‘void (*)(const void *, void *)’
139 | GFunc func,
| ~~~~~~~~~~~~~~~~~~^~~~
../src/MainWindow.vala: In function ‘__lambda35_’:
../src/MainWindow.vala:800:26: error: passing argument 2 of ‘g_list_foreach’ from incompatible pointer type [-Wincompatible-pointer-types]
800 | history.foreach ((entry) => {
| ^~~~~~~~~~~~~~~~
| |
| void (*)(const void *, void *)
/usr/include/glib-2.0/glib/glist.h:139:60: note: expected ‘GFunc’ {aka ‘void (*)(void *, void *)’} but argument is of type ‘void (*)(const void *, void *)’
139 | GFunc func,
| ~~~~~~~~~~~~~~~~~~^~~~
../src/MainWindow.vala: In function ‘pantheon_calculator_main_window_constructor’:
../src/MainWindow.vala:79:141: error: passing argument 3 of ‘gtk_application_set_accels_for_action’ from incompatible pointer type [-Wincompatible-pointer-types]
79 | application_instance.set_accels_for_action (ACTION_PREFIX + ACTION_CLEAR, {"Escape"});
| ^
| |
| gchar ** {aka char **}
In file included from /usr/include/gtk-4.0/gtk/gtkwindow.h:32,
from /usr/include/gtk-4.0/gtk/gtkaboutdialog.h:29,
from /usr/include/gtk-4.0/gtk/gtk.h:33:
/usr/include/gtk-4.0/gtk/gtkapplication.h:131:88: note: expected ‘const char * const*’ but argument is of type ‘gchar **’ {aka ‘char **’}
131 | const char * const *accels);
| ~~~~~~~~~~~~~~~~~~~~~^~~~~~
../src/MainWindow.vala:80:140: error: passing argument 3 of ‘gtk_application_set_accels_for_action’ from incompatible pointer type [-Wincompatible-pointer-types]
80 | application_instance.set_accels_for_action (ACTION_PREFIX + ACTION_UNDO, {"z"});
| ^
| |
| gchar ** {aka char **}
/usr/include/gtk-4.0/gtk/gtkapplication.h:131:88: note: expected ‘const char * const*’ but argument is of type ‘gchar **’ {aka ‘char **’}
131 | const char * const *accels);
| ~~~~~~~~~~~~~~~~~~~~~^~~~~~
../src/MainWindow.vala:81:141: error: passing argument 3 of ‘gtk_application_set_accels_for_action’ from incompatible pointer type [-Wincompatible-pointer-types]
81 | application_instance.set_accels_for_action (ACTION_PREFIX + ACTION_COPY, {"c"});
| ^
| |
| gchar ** {aka char **}
/usr/include/gtk-4.0/gtk/gtkapplication.h:131:88: note: expected ‘const char * const*’ but argument is of type ‘gchar **’ {aka ‘char **’}
131 | const char * const *accels);
| ~~~~~~~~~~~~~~~~~~~~~^~~~~~
../src/MainWindow.vala:82:142: error: passing argument 3 of ‘gtk_application_set_accels_for_action’ from incompatible pointer type [-Wincompatible-pointer-types]
82 | application_instance.set_accels_for_action (ACTION_PREFIX + ACTION_PASTE, {"v"});
| ^
| |
| gchar ** {aka char **}
/usr/include/gtk-4.0/gtk/gtkapplication.h:131:88: note: expected ‘const char * const*’ but argument is of type ‘gchar **’ {aka ‘char **’}
131 | const char * const *accels);
| ~~~~~~~~~~~~~~~~~~~~~^~~~~~
ninja: build stopped: cannot make progress due to previous errors.
```

### Steps to Reproduce

build with gcc 14.x from rawhide

### Expected Behavior

Build should not fail.

### OS Version

7.x (Horus)

### Software Version

Latest release (I have run all updates)

### Log Output

_No response_

### Hardware Info

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.