What am I missing?
Andrew Haley
aph@redhat.com
Tue Jul 1 18:12:00 GMT 2008
JJ wrote:
> When compiling my code on Ubuntu 8.04 with g++ 4.2.x my compile is clean. When I compile the same code on
> Fedora7 with 4.1.x or 4.2.x I receive a lot of errors like the following... Is there a lib or something
> missing to handle these errors?
There's not enough information here. Please post a complete
self-contained test case that demonstrates the problem. It must
include the exact compiler options you used.
> c.cpp:902: error: cast from ?const char*? to ?int? loses precision
> c.cpp:904: error: cast from ?double*? to ?int? loses precision
> c.cpp:907: error: cast from ?const char*? to ?int? loses precision
> c.cpp:909: error: cast from ?double*? to ?int? loses precision
>
> const char* number_type_ptr = "N";
>
> int equals_operator( int ltype, binary_pair* lset, int rtype, binary_pair* rset,
> double*& result, op_checker* checker, double checker_arg2 )
> {
> int wrk_value = 1;
> double* lresult;
> double* rresult;
> int lcount = 0, rcount = 0;
> double lckarg = 0.0, rckarg = 0.0;
> op_checker* lchecker = NULL;
> op_checker* rchecker = NULL;
> int i;
>
> if( ltype == (int) number_type_ptr ) { //line 902
> lcount = 0;
> rckarg = (int) ( lresult = (double*) lset ); //line 904
> rchecker = equals_check;
> }
> if( rtype == (int) number_type_ptr ) { //line 907
> rcount = 0;
> lckarg = (int) ( rresult = (double*) rset ); //line 909
> lchecker = equals_check;
> }
>
> Thanks in advance for assistance.
More information about the Gcc-help
mailing list