After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 791494 - gstiirequalizer.c:326:7: error: assignment from incompatible pointer type
gstiirequalizer.c:326:7: error: assignment from incompatible pointer type
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other Linux
: Normal normal
: 1.12.5
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-12-11 21:27 UTC by Michael Catanzaro
Modified: 2018-01-17 14:19 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
equalizer: Fix -Wincompatible-pointer-types warning (996 bytes, patch)
2017-12-11 21:28 UTC, Michael Catanzaro
committed Details | Review

Description Michael Catanzaro 2017-12-11 21:27:03 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.
Comment 1 Michael Catanzaro 2017-12-11 21:28:16 UTC
Created attachment 365393 [details] [review]
equalizer: Fix -Wincompatible-pointer-types warning

This is caused by the new type propagation for g_object_ref.
Comment 2 Michael Catanzaro 2017-12-11 21:29:09 UTC
(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.
Comment 3 Michael Catanzaro 2017-12-11 21:46:57 UTC
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.)
Comment 4 Tim-Philipp Müller 2017-12-11 21:55:45 UTC
There is --disable-fatal-warnings
Comment 5 Tim-Philipp Müller 2017-12-11 21:56:40 UTC
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!
Comment 6 Tim-Philipp Müller 2017-12-11 22:01:00 UTC
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
Comment 7 Michael Catanzaro 2017-12-12 04:12:37 UTC
(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.
Comment 8 Nicolas Dufresne (ndufresne) 2017-12-12 04:26:34 UTC
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.
Comment 9 Tim-Philipp Müller 2017-12-12 09:51:50 UTC
I pondered changing it to a simple cast, but since it wasn't in a performance critical part code I didn't bother.