[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#325357: vrweb: FTBFS on 64 bit arches: cast from 'AnyLight*' to 'int' loses precision

[Kurt Roeckx]
> Your package is failing to build on 64 bit arches with the following
> error:

Heh, I guess it always was broken, but no-one used it on 64-bit archs. :)

> It's trying to print the address.  In C, with printf, you'd use a %p
> for it.  I have no idea if std::cout has something simular.

Is this the only place this is happening?  Did it compile when this
line is fixed?  Is this the only 64-bit problem in this code?

> I think the easiest way to fix it would be cast it to an intptr_t.

The code in question is debug output.  I guess it is trying to print
out a pointer, yes.  Why not just drop the cast completely?

   FaceAttr* faceattr = new FaceAttr(vertex_num, vertexlist_wc,
                                     0 /*normal_num*/, normallist_wc);
   std::cout << "addr of light_: " << faceattr->light() << std::endl;
 * std::cout << int (*(faceattr->light())) << std::endl;

faceattr->light() returns 'AnyLight**', and thus this line try to
print 'AnyLight*'.  If it can porint 'AnyLight**', it should be
capable of printing 'AnyLight*' too.

Reply to: