GNOME Bugzilla – Bug 172387
Fails to compile on AMD64 with gcc 4.0
Last modified: 2011-01-16 23:35:19 UTC
x86_64-linux-g++ -DHAVE_CONFIG_H -DG_LOG_DOMAIN=\"gconfmm\" -I../../gconf -I../../gconf -DORBIT2=1 -pthread -I/usr/include/gtkmm-2.0 -I/usr/lib/gtkmm-2.0/include -I/usr/lib/sigc++-1.2/include -I/usr/include/sigc++-1.2 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/gconf/2 -I/usr/include/orbit-2.0 -g -O2 -MT client.lo -MD -MP -MF .deps/client.Tpo -c client.cc -fPIC -DPIC -o .libs/client.o client.cc: In member function 'GSList* Gnome::Conf::Client::get_list(const Glib::ustring&, GConfValueType) const': client.cc:185: error: cast from 'void*' to 'int' loses precision client.cc:188: error: cast from 'void*' to 'gboolean' loses precision make[5]: *** [client.lo] Error 1 make[5]: Leaving directory `/gconfmm2.0-2.0.2/gconf/gconfmm'
This seems to fix it: diff -urN ../tmp-orig/gconfmm2.0-2.0.2/gconf/gconfmm/client.cc ./gconf/gconfmm/client.cc --- ../tmp-orig/gconfmm2.0-2.0.2/gconf/gconfmm/client.cc 2004-05-08 14:25:26.000000000 +0200 +++ ./gconf/gconfmm/client.cc 2004-12-20 16:29:22.677364528 +0100 @@ -182,10 +182,10 @@ switch(list_type) { case GCONF_VALUE_INT: - gconf_value_set_int(v,(int)i->data); + gconf_value_set_int(v,(long)i->data); break; case GCONF_VALUE_BOOL: - gconf_value_set_bool(v,(gboolean)i->data); + gconf_value_set_bool(v,i->data!=0); break; case GCONF_VALUE_FLOAT: gconf_value_set_float(v,*(gdouble*)i->data);
I'm not very happy with the void* to long to int conversion, though I guess I can live with the gboolean change. Maybe we should be using GPOINTER_TO_INT(), though I think that only works if gconf has create the value with GINT_TO_POINTER().
Both changes committed to HEAD. Thanks.