GNOME Bugzilla – Bug 613387
[gio] compiler warning with GLib 2.18, breaks build with -Werror
Last modified: 2010-03-20 13:51:28 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); <<<
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 :)