GNOME Bugzilla – Bug 791494
gstiirequalizer.c:326:7: error: assignment from incompatible pointer type
Last modified: 2018-01-17 14:19:00 UTC
gst-plugins-good is currently bringing down the GNOME SDK build. The failure is: gstiirequalizer.c: In function ‘gst_iir_equalizer_child_proxy_get_child_by_index’: gstiirequalizer.c:326:7: error: assignment from incompatible pointer type [-Werror=incompatible-pointer-types] ret = g_object_ref (equ->bands[index]); ^ cc1: all warnings being treated as errors It's caused by bug #790697 (type propagation for ref/unref). We should probably consider calling configure with --disable-werror, or adding -Wno-error to CFLAGS, or switching to the meson build where this would not happen, or something along those lines. But this is easy enough to just fix.
Created attachment 365393 [details] [review] equalizer: Fix -Wincompatible-pointer-types warning This is caused by the new type propagation for g_object_ref.
(In reply to Michael Catanzaro from comment #0) > gst-plugins-good is currently bringing down the GNOME SDK build. Note: this seems to be the only such warning in gst-plugins-good.
I found https://cgit.freedesktop.org/gstreamer/common/tree/m4/gst-error.m4... looks like make time is the only opportunity to disable warnings as errors. So we'll probably just live with these until we switch to using meson. (Probably no particular reason not to do that now... just got to make sure it works.)
There is --disable-fatal-warnings
I built all of GStreamer against glib from git master just a few days ago to see if this had any impact on us, but didn't run into any issues, strange. Thanks for that patch!
Thanks! commit d9235cdb498da2070193e33dcad29c42d20a219f (HEAD -> master) Author: Michael Catanzaro <mcatanzaro@igalia.com> Date: Mon Dec 11 15:27:08 2017 -0600 equalizer: Fix -Wincompatible-pointer-types warning This is caused by the new type propagation for g_object_ref. https://bugzilla.gnome.org/show_bug.cgi?id=791494
(In reply to Tim-Philipp Müller from comment #5) > I built all of GStreamer against glib from git master just a few days ago to > see if this had any impact on us, but didn't run into any issues, strange. > Thanks for that patch! I spot a couple in a local build of the gstreamer repository (but the SDK builder doesn't seem to care, so I won't report a new bug): [32/463] Compiling C object 'gst/gstreamer-1.0@sha/meson-generated_.._parse_grammar.tab.c.o'. ../../../../Projects/GNOME/gstreamer/gst/parse/grammar.y: In function ‘gst_parse_element_set’: ../../../../Projects/GNOME/gstreamer/gst/parse/grammar.y:409:14: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types] target = g_object_ref (element); ^ [37/463] Compiling C object 'gst/gstreamer-1.0@sha/gstdeviceproviderfactory.c.o'[38/463] Compiling C object 'gst/gstreamer-1.0@sha/gstchildproxy.c.o'. ../../../../Projects/GNOME/gstreamer/gst/gstchildproxy.c: In function ‘gst_child_proxy_lookup’: ../../../../Projects/GNOME/gstreamer/gst/gstchildproxy.c:193:7: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types] obj = g_object_ref (object); ^ I've only tested gstreamer and gst-plugins-base, not any of the other repositories.
Not sure how relevant this "feature" is if it mostly show false positive. Like the last one, we ref a ChildProxy and store it in a GObject pointer. There is absolutely nothing wrong about that, and adding a dynamic type check is not going to add anything. Specially that there is already a type check in the ref function, and this function also do that check. When "fixing" this, I would just C cast the gpointer imho.
I pondered changing it to a simple cast, but since it wasn't in a performance critical part code I didn't bother.