GNOME Bugzilla – Bug 478347
GST_STATIC_PAD_TEMPLATE macro causes warnings with g++-4.2
Last modified: 2007-09-19 13:33:10 UTC
+++ This bug was initially created as a clone of Bug #478092 +++ Got the following compiler error: gcc -DHAVE_CONFIG_H -I. -I../.. -pthread -I/opt/jhbuild/include/gstreamer-0.10 -I/opt/jhbuild/include/glib-2.0 -I/opt/jhbuild/lib64/glib-2.0/include -I/opt/jhbuild/include/libxml2 -I../../gst-libs -I../../gst-libs -pthread -I/opt/jhbuild/include/gstreamer-0.10 -I/opt/jhbuild/include/glib-2.0 -I/opt/jhbuild/lib64/glib-2.0/include -I/opt/jhbuild/include/libxml2 -Wall -Werror -g -DGST_DISABLE_DEPRECATED -I/usr/include/taglib -ggdb3 -O2 -MT libgsttaglib_la-gsttaglibmux.lo -MD -MP -MF .deps/libgsttaglib_la-gsttaglibmux.Tpo -c gsttaglibmux.c -fPIC -DPIC -o .libs/libgsttaglib_la-gsttaglibmux.o g++ -DHAVE_CONFIG_H -I. -I../.. -pthread -I/opt/jhbuild/include/gstreamer-0.10 -I/opt/jhbuild/include/glib-2.0 -I/opt/jhbuild/lib64/glib-2.0/include -I/opt/jhbuild/include/libxml2 -I../../gst-libs -I../../gst-libs -pthread -I/opt/jhbuild/include/gstreamer-0.10 -I/opt/jhbuild/include/glib-2.0 -I/opt/jhbuild/lib64/glib-2.0/include -I/opt/jhbuild/include/libxml2 -Wall -Werror -g -DGST_DISABLE_DEPRECATED -I/usr/include/taglib -g -O2 -MT libgsttaglib_la-gstid3v2mux.lo -MD -MP -MF .deps/libgsttaglib_la-gstid3v2mux.Tpo -c gstid3v2mux.cc -fPIC -DPIC -o .libs/libgsttaglib_la-gstid3v2mux.o cc1plus: warnings being treated as errors gstid3v2mux.cc:73: warning: deprecated conversion from string constant to 'gchar*' gstid3v2mux.cc:73: warning: deprecated conversion from string constant to 'gchar*' gstid3v2mux.cc:73: warning: deprecated conversion from string constant to 'gchar*' gstid3v2mux.cc:73: warning: deprecated conversion from string constant to 'gchar*' gstid3v2mux.cc:78: warning: deprecated conversion from string constant to 'gchar*' gstid3v2mux.cc: In function 'void gst_id3v2_mux_base_init(void*)': gstid3v2mux.cc:100: warning: deprecated conversion from string constant to 'gchar*' gstid3v2mux.cc:100: warning: deprecated conversion from string constant to 'gchar*' make[3]: *** [libgsttaglib_la-gstid3v2mux.lo] Fout 1 Note: gcc (GCC) 4.2.2 20070909 (prerelease), x86_64.
Should be fixed now (could have just put in a cast, but that seems a bit ugly): 2007-09-19 Tim-Philipp Müller <tim at centricular dot net> * gst/glib-compat-private.h: Add compatibility macro for g_intern_string() for GLib-2.8 (any reason we can't just bump the requirement to at least 2.10?) * gst/gstpadtemplate.h: * gst/gstelementfactory.c: * gst/gstregistryxml.c: * gst/gstregistrybinary.c: Make GstStaticPadTemplate's templ_name field a const gchar * and fix up the internal code accordingly. This shouldn't be a problem, since there is no reason external code could ever assume the string in such a structure is dynamically allocated unless it did that itself; the use of g_strdup() is private to element factories. The new code also saves some memory by putting pad template name strings into the GLib quark table instead of allocating them dynamically. Declaring this field constant fixes warnings with g++-4.2 when using the GST_STATIC_PAD_TEMPLATE macro in c++ code (#478092).