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 613387 - [gio] compiler warning with GLib 2.18, breaks build with -Werror
[gio] compiler warning with GLib 2.18, breaks build with -Werror
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
git master
Other Linux
: Normal normal
: 0.10.29
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2010-03-20 08:38 UTC by Tetsuya Yasuda
Modified: 2010-03-20 13:51 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Tetsuya Yasuda 2010-03-20 08:38:58 UTC
Following compile error is happen on my environment.

>>>
[...]
make[3]: Entering directory `/home/tetsuya/Work/gitrepos/gst-plugins-base/ext/gio'
  CC     libgstgio_la-gstgiobasesrc.lo
cc1: warnings being treated as errors
gstgiobasesrc.c: In function 'gst_gio_base_src_get_size':
gstgiobasesrc.c:193: error: passing argument 2 of 'g_file_input_stream_query_info' discards qualifiers from pointer target type
[...]
<<<

My environment:
 Fedora 10
 gcc (GCC) 4.3.2 20081105 (Red Hat 4.3.2-7)
 gstreamer-0.10 (built on git-master)

I success to compile it if following patch is applied.

>>>
diff --git a/ext/gio/gstgiobasesrc.c b/ext/gio/gstgiobasesrc.c
index 133e12c..bcafa3d 100644
--- a/ext/gio/gstgiobasesrc.c
+++ b/ext/gio/gstgiobasesrc.c
@@ -190,7 +190,7 @@ gst_gio_base_src_get_size (GstBaseSrc * base_src, guint64 * size)
     GError *err = NULL;
 
     info = g_file_input_stream_query_info (G_FILE_INPUT_STREAM (src->stream),
-        G_FILE_ATTRIBUTE_STANDARD_SIZE, src->cancel, &err);
+        (char*)G_FILE_ATTRIBUTE_STANDARD_SIZE, src->cancel, &err);
 
     if (info != NULL) {
       *size = g_file_info_get_size (info);
<<<
Comment 1 Tim-Philipp Müller 2010-03-20 13:51:28 UTC
Fixed, thanks:

commit 197fe6d0d1b3a9c2d8816d1540b3b9914e6cbf1a
Author: Tim-Philipp Müller <tim.muller@collabora.co.uk>
Date:   Sat Mar 20 13:42:32 2010 +0000

    gio: add cast to avoid compiler warning with old GLib versions
    
    g_file_input_stream_query_info() had char * instead of const char *
    as attribute argument before 2.20.
    
    Fixes #613387, spotted by tetsuyayasuda@gmail.com

Would be nice if you could configure bugzilla with your proper name, so I can give you full/proper attribution next time :)