Bug #11751 Fails to compile on 64-bit arches
Submitted: 5 Jul 2005 21:54 Modified: 23 May 2006 17:59
Reporter: [ name withheld ] Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Query Browser Severity:S2 (Serious)
Version:1.1.18 OS:Linux (Debian/Linux)
Assigned to: Alfredo Kojima CPU Architecture:Any

[5 Jul 2005 21:54] [ name withheld ]
Description:
Fails to compile on 64-bit architectures. For example, on ia64,

http://buildd.debian.org/fetch.php?&pkg=mysql-query-browser&ver=1.1.12-1&arch=ia64&stamp=1...

MGResultSetModel.cc: In member function `virtual bool 
   MGResultSetModel::iter_nth_child_vfunc(GtkTreeIter*, const GtkTreeIter*, 
   int)':
MGResultSetModel.cc:156: warning: cast to pointer from integer of different 
   size
MGResultSetModel.cc: In member function `virtual bool 
   MGResultSetModel::get_iter_vfunc(GtkTreeIter*, const Gtk::TreePath&)':
MGResultSetModel.cc:220: warning: cast to pointer from integer of different 
   size
MGResultSetModel.cc: In member function `virtual void 
   MGResultSetModel::get_value_vfunc(const Gtk::TreeIter&, int, GValue*)':
MGResultSetModel.cc:367: error: no matching function for call to `
   MGResultSetModel::get_value(const Gtk::TreeIter&, int&, void*&, gsize&)'
MGResultSetModel.cc:227: error: candidates are: bool 
   MGResultSetModel::get_value(const Gtk::TreeIter&, unsigned int, void*&, 
   guint&)
MGResultSetModel.cc: In member function `Gtk::TreeIter 
   MGResultSetModel::append()':
MGResultSetModel.cc:490: warning: cast to pointer from integer of different 
   size
make[4]: *** [MGResultSetModel.o] Error 1

How to repeat:
.

Suggested fix:
See attached patch.

But, I do have some concerns about casting int <-> pointers since on 64-bit architectures sizeof(int) != sizeof(void*) since sizeof(long)==sizeof(void*). Are these casts valid? If these casts are actual pointers, then mysql-query-browser will NOT work on 64-bit architectures, including Amd64.
[5 Jul 2005 21:54] [ name withheld ]
the patch

Attachment: patch.upstream (application/octet-stream, text), 2.66 KiB.

[6 Jul 2005 3:16] Jorge del Conde
I was able to reproduce this using WinXP64 & AMD64
[8 Sep 2005 1:49] [ name withheld ]
1.1.14 has even more of these problems.
[29 Nov 2005 16:17] Greg
Is there any movement on this? I cannot get any of these versions to work: 1.1.17, 1.1.14, 1.1.12. They all die at the pointer cast. Is this at all related to http://bugs.mysql.com/bug.php?id=8340 ?
[29 Nov 2005 17:06] Greg
For 1.1.17 you need to edit:
MGResultSetModel.cc file:
402:       if (get_value(iter_, (unsigned int)column, data, (guint&) size))
MQResultSetView.cc
1885:    if (_model->get_value(iter, (unsigned int) column*2, fdata, (guint&) fsize))
similar changes to lines 1911 and  1985
[13 Jan 2006 2:16] [ name withheld ]
Also in latest release
[23 May 2006 17:59] Alfredo Kojima
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html

Additional info:

thanks for the patch!