GNOME Bugzilla – Bug 478092
gstid3v2mux.cc:deprecated conversion from string constant to 'gchar*' with g++-4.2
Last modified: 2007-09-19 13:36:26 UTC
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.
core: 2007-09-18 Tim-Philipp Müller <tim at centricular dot net> * gst/gstinfo.c: * gst/gstinfo.h: Make some internal API take const gchar * instead of just gchar * to avoid compiler warnings with g++-4.2.2 when passing string constants (partially fixes #478092). -good: 2007-09-18 Tim-Philipp Müller <tim at centricular dot net> * ext/taglib/gstapev2mux.cc: * ext/taglib/gstid3v2mux.cc: Fix compiler warnings with g++-4.2 when assigning a string constant to a gchar * (partially fixes #478092). Needs one more fix in core though, will do that tomorrow.
Seems you forgot to commit the -good patch (or the commits ML is broken again) ;)
Should all be fixed now, sorry for the delay: 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).