Bugzilla – Bug 1227581
Bug report: Vala-generated C code produces int-conversion error in gcc14, causing build to fail
Last modified: 2024-07-10 07:13:01 UTC
Created attachment 875963 [details] Build log Summary: I have observed this issue while building the latest GNOME:Factory/gnome-boxes package using pre-release gcc14 from home:rguenther:plgrnd/gcc. I'm building in home:gkenion:gcc14, in which the gnome-boxes and gcc packages are linked to GNOME:Factory and home:rguenther:plagrnd, respectively. The build fails during C compilation, with the following error (from attatched boxes.gcc14.build.log): 2231 [ 23s] In file included from /usr/include/glib-2.0/glib.h:64, 2232 [ 23s] from /usr/include/glib-2.0/gobject/gbinding.h:30, 2233 [ 23s] from /usr/include/glib-2.0/glib-object.h:24, 2234 [ 23s] from src/gnome-boxes.p/libvirt-broker.c:6: 2235 [ 23s] src/gnome-boxes.p/libvirt-broker.c: In function ‘boxes_libvirt_broker_add_domain_co’: 2236 [ 23s] /usr/include/glib-2.0/glib/gmessages.h:671:16: error: returning ‘void *’ from a function with return type ‘gboolean’ {aka ‘int’} makes integer from pointer without a cast [-W int-conversion] 2237 [ 23s] 671 | return (val); \ 2238 [ 23s] | ^ In this case, the errant call appears in gmessages.h, which is generated by vala during the build. Workaround would be to specify more permissive c_args. Would also be worthwhile to communicate this issue to upstream devs, if they aren't already aware. I haven't found anything indicating they are, but I figured the OpenSUSE GNOME maintainers would follow upstream more closely than I do, and might have existing rapport with the devs. Steps to reproduce: Build the home:gkenion:gcc14/gnome:boxes package hosted on the OpenSUSE OBS instance.
I can reproduce this and I am trying to find the reason.
``` ../src/libvirt-broker.vala:29:2: note: in expansion of macro ‘g_return_val_if_fail’ 29 | return_val_if_fail (broker != null, null); | ^ ~~~~~~~~~~~~~ ``` I think the reason is vala translate async function into something returns boolean as status and pass the actual result as argument via pointer, but `g_return_val_if_fail` is a C macro, so it directly returns the generated function, which should return an boolean. There are already upstream bugs: https://gitlab.gnome.org/GNOME/vala/-/issues/1005 , looks like return_val_if_fail should not be used in vala. I'll open an issue to gnome-boxes.
There is already one bug: https://gitlab.gnome.org/GNOME/gnome-boxes/-/issues/1073
(In reply to Alynx Zhou from comment #3) > There is already one bug: > https://gitlab.gnome.org/GNOME/gnome-boxes/-/issues/1073 Thank you for your looking into this. I didn't realize #1073 was the same issue, sorry for duplicating.