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 478092 - gstid3v2mux.cc:deprecated conversion from string constant to 'gchar*' with g++-4.2
gstid3v2mux.cc:deprecated conversion from string constant to 'gchar*' with g+...
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other All
: Normal blocker
: 0.10.15
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on: 478347
Blocks:
 
 
Reported: 2007-09-18 16:44 UTC by Olav Vitters
Modified: 2007-09-19 13:36 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Olav Vitters 2007-09-18 16:44:23 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.
Comment 1 Tim-Philipp Müller 2007-09-18 22:24:12 UTC
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.
Comment 2 Sebastian Dröge (slomo) 2007-09-19 05:19:24 UTC
Seems you forgot to commit the -good patch (or the commits ML is broken again) ;)
Comment 3 Tim-Philipp Müller 2007-09-19 13:36:26 UTC
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).