Standard_Integer too small on x86_64...

Hi all,

I've been struggling with compiling OCC on 64bit Ubuntu for a few days and finally made serious headway after applying Jason Kraftcheck's patches ( http://www.opencascade.org/org/forum/thread_12563/ .) Unfortunately I've run into these 2 instances (so far) of void pointers being cast as standard ints in OCC. Here are the errors I got after 3 hours of compilation:

../../../src/Draw/Draw_VariableCommands.cxx: In function 'char* tracevar(void*, Tcl_Interp*, char*, char*, Standard_Integer)':
../../../src/Draw/Draw_VariableCommands.cxx:661: error: cast from 'void*' to 'Standard_Integer' loses precision
../../../src/Draw/Draw_VariableCommands.cxx: In static member function 'static Handle_Draw_Drawable3D Draw::Get(char*&, Standard_Boolean)':
../../../src/Draw/Draw_VariableCommands.cxx:776: error: cast from 'void*' to 'Standard_Integer' loses precision

Does anyone know a definitive fix for this issue? Why have other 64 bit users not encountered the same problem? Thanks in advance for any advice!

-Seth

Mikael Aronsson's picture

It does look like a bug as far I can see, they try to convert a void* (64 bits) to a Standard_Integer (32 bits says the OCC doc) and that will not work.

Seth Jackson's picture

is this something people out there have fixed before? it seems to me that anyone with a 64bit build would have run into this.

Seth Jackson's picture

so, i just changed them.

Svetlozar Kostadinov's picture

Maybe these should be Standard_Address (which is typedef void*) instead of Standard_Integer's.

Seth Jackson's picture

that makes sense. i used longs, because on my system they're 64 bit, which isn't a good solution, but it worked.

P G's picture

Anybody compared the performance of 64 - bit and 32 bit version
on a common h/w platform .. r there any bench mark results ?

P Dolbey's picture

I'm going to try to mark useful posts that have patches provided like so

OCCPATCH

so I can find them later for my patch repository using the forum search function. Hope nobody minds.

Pete