[Symphony-tickets] [SYMPHONY] #55: Incorrect cast for 64 bit?

SYMPHONY coin-trac at coin-or.org
Fri Nov 3 12:52:47 EST 2006


#55: Incorrect cast for 64 bit?
---------------------+------------------------------------------------------
 Reporter:  fmargot  |       Owner:  tkr
     Type:  defect   |      Status:  new
 Priority:  normal   |   Milestone:     
Component:  VRP      |     Version:     
 Severity:  normal   |    Keywords:     
---------------------+------------------------------------------------------
 When using g++ with version:

 g++ -v
 Using built-in specs.
 Target: x86_64-redhat-linux
 Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
 --infodir=/usr/share/info --enable-shared --enable-threads=posix --enable-
 checking=release --with-system-zlib --enable-__cxa_atexit --disable-
 libunwind-exceptions --enable-libgcj-multifile --enable-
 languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk
 --disable-dssi --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre
 --with-cpu=generic --host=x86_64-redhat-linux
 Thread model: posix
 gcc version 4.1.1 20060525 (Red Hat 4.1.1-1)

 on a 64 bits machine, I get an error when compiling
 the VRP application:
 g++ -O3 -fomit-frame-pointer -pipe -DNDEBUG -pedantic-errors -Wimplicit
 -Wparentheses -Wreturn-type -Wcast-qual -Wall -Wpointer-arith -Wwrite-
 strings -Wconversion   -Wno-unknown-pragmas -Wno-write-strings -Wno-sign-
 compare -Wno-cast-qual -Iinclude -I`echo
 /home/fmargot/SYMPHONY-5.1/include` -I`echo
 /home/fmargot/SYMPHONY-5.1/SYMPHONY/include` -I`echo /include`
 -DUSE_CGL_CUTS -D__OSI_CLP__ -DHAS_RANDOM -DHAS_SRANDOM -D__NONE__
 -D__LINUX -DCOMPILE_IN_CG -DCOMPILE_IN_CP -DCOMPILE_IN_LP -DCOMPILE_IN_TM
 -c -o src/Master/vrp_master_functions.o `test -f
 'src/Master/vrp_master_functions.c' || echo
 '/'`src/Master/vrp_master_functions.c
 src/Master/vrp_master_functions.c: In function â:
 src/Master/vrp_master_functions.c:58: error: cast from â to â loses
 precision
 src/Master/vrp_master_functions.c:58: error: cast from â to â loses
 precision
 make: *** [src/Master/vrp_master_functions.o] Error 1

 The cuplprit the line:

    pos = ((int)ed0 - (int)g->edges)/sizeof(edge_data) + 1;

 casting a pointer to an integer. Now idea how to fix this.

-- 
Ticket URL: <https://projects.coin-or.org/SYMPHONY/ticket/55>
SYMPHONY <http://projects.coin-or.org/SYMPHONY>
The SYMPHONY framework for parallel branch-and-cut algorithms.



More information about the Symphony-tickets mailing list