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 172387 - Fails to compile on AMD64 with gcc 4.0
Fails to compile on AMD64 with gcc 4.0
Status: RESOLVED FIXED
Product: gconfmm
Classification: Other
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: gtkmm-forge
gtkmm-forge
Depends on:
Blocks:
 
 
Reported: 2005-04-01 19:03 UTC by btb
Modified: 2011-01-16 23:35 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description btb 2005-04-01 19:03:05 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'
Comment 1 btb 2005-04-01 19:04:15 UTC
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);
Comment 2 Murray Cumming 2005-04-09 12:07:29 UTC
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().
Comment 3 Murray Cumming 2005-04-24 14:18:59 UTC
Both changes committed to HEAD. Thanks.