build problems on amd64
|
Author |
Message |
dcharno
Junior Member
 
Posts: 10
Group: Registered
Joined: May 2007
Status:
Offline
Reputation: 0
|
build problems on amd64
I'm trying to build murgalua on an amd64, but the following cast
lua_getref(S, (int) udata);
fails to compile
bind-fltk.cxx: In function ‘int lua_call1_fl_ask(lua_State*)’:
bind-fltk.cxx:8940: warning: ‘fl_ask’ is deprecated (declared at /usr/include/FL/fl_ask.H:59)
bind-fltk.cxx:8940: warning: ‘fl_ask’ is deprecated (declared at /usr/include/FL/fl_ask.H:59)
bind-fltk-ext.cxx: In function ‘void lua_fltk_widget_callback(Fl_Widget*, void*)’:
bind-fltk-ext.cxx:37: error: cast from ‘void*’ to ‘int’ loses precision
make[2]: *** [bind-fltk-ext.o] Error 1
|
|
05-05-2007 03:40 PM |
|
 |
Tobi
Junior Member
 
Posts: 20
Group: Registered
Joined: May 2007
Status:
Offline
Reputation: 0
|
RE: build problems on amd64
Hi, maybe your compiler is set too pedantic.
Try setting the -fms-extensions and -fpermissive compiler flags
Are you using GCC via MingW ?
|
|
05-11-2007 04:44 PM |
|
 |
Juergen
Member
  
Posts: 81
Group: Registered
Joined: May 2007
Status:
Offline
Reputation: 0
|
RE: build problems on amd64
Hi, maybe your compiler is set too pedantic.
Try setting the -fms-extensions and -fpermissive compiler flags
Are you using GCC via MingW ?
Or maybe the compiler is right (At least with the error message).
If I remember correctly (I have currently no such machine at hand), the size of int is 32 bit on amd64 (with gcc) and the size of void* is of course 64bit. Therefore the cast is wrong. It looks like the code is not 64 bit clean (at least not on AMD64 with gcc), because it makes some assumptions that are not always true.
|
|
05-11-2007 09:29 PM |
|
 |
dcharno
Junior Member
 
Posts: 10
Group: Registered
Joined: May 2007
Status:
Offline
Reputation: 0
|
RE: build problems on amd64
If I remember correctly (I have currently no such machine at hand), the size of int is 32 bit on amd64 (with gcc) and the size of void* is of course 64bit. Therefore the cast is wrong. It looks like the code is not 64 bit clean (at least not on AMD64 with gcc), because it makes some assumptions that are not always true.
Yes, this is exactly what is happening -- trying to store a 64-bit pointer in a 32-bit int. I was thinking about creating a C++ container to map a unique integer to the udata pointer.
|
|
05-12-2007 06:59 AM |
|
 |