[Q_AT_ping_dot_be: Bug#279991: inkscape: FTBFS: error: reinterpret_cast from `void*' to `int' loses precision]
Hi,
I just received this bug report about (not) building inkscape in Debian's BTS.
With best regards,
Wolfi
----- Forwarded message from Kurt Roeckx <Q_AT_ping_dot_be -----
X-Original-To: wolfi@...33... X-Original-To: wolfi@...111... Subject: Bug#279991: inkscape: FTBFS: error: reinterpret_cast from `void*' to `int' loses precision Reply-To: Kurt Roeckx <Q_AT_ping_dot_be, 279991@...499... Resent-From: Kurt Roeckx <Q_AT_ping_dot_be Original-Sender: Q@...560... Resent-To: debian-bugs-dist@...501... Resent-Cc: Wolfram Quester <wolfi@...111...> Resent-Date: Sat, 06 Nov 2004 15:03:01 UTC Resent-Message-ID: <handler.279991.B.109975247611270@...499...> X-Debian-PR-Message: report 279991 X-Debian-PR-Package: inkscape X-Debian-PR-Keywords: Date: Sat, 6 Nov 2004 15:47:55 +0100 From: Kurt Roeckx <Q_AT_ping_dot_be To: submit@...499... Resent-Sender: Debian BTS <debbugs@...499...> X-Virus-Scanned: by amavisd-new-20030616-p7 (Debian) at honk.physik.uni-konstanz.de X-Virus-Scanned: by amavisd-new-20030616-p7 (Debian) at honk.physik.uni-konstanz.de
Package: inkscape Version: 0.39+0.40pre1-1 Severity: serious
The package is failing to build on all 64 bit arches (alpha, ia64, amd64) with the following error: In file included from selection.h:25, from arc-context.cpp:30: gc-finalized.h: In static member function `static Inkscape::GC::Finalized* Inkscape::GC::Finalized::_unoffset(void*, void*)': gc-finalized.h:66: error: reinterpret_cast from `void*' to `int' loses precision arc-context.cpp: In function `void shape_event_attr_changed(SPRepr*, const gchar*, const gchar*, const gchar*, bool, void*)': arc-context.cpp:148: warning: unused parameter `SPRepr*repr' arc-context.cpp:148: warning: unused parameter `const gchar*name' arc-context.cpp:148: warning: unused parameter `const gchar*old_value' arc-context.cpp:148: warning: unused parameter `const gchar*new_value' arc-context.cpp:148: warning: unused parameter `bool is_interactive' make[3]: *** [arc-context.o] Error 1
Casting a void * to an int is probably a very bad thing to do. A void * is 64 bit on those arches while an int is 32 bit.
Kurt
----- End forwarded message -----
On Sun, 2004-11-07 at 05:30, Wolfram Quester wrote:
Hi,
I just received this bug report about (not) building inkscape in Debian's BTS.
With best regards,
Wolfi
[snip]
In file included from selection.h:25, from arc-context.cpp:30: gc-finalized.h: In static member function `static Inkscape::GC::Finalized* Inkscape::GC::Finalized::_unoffset(void*, void*)': gc-finalized.h:66: error: reinterpret_cast from `void*' to `int' loses precision
[snip]
Casting a void * to an int is probably a very bad thing to do. A void * is 64 bit on those arches while an int is 32 bit.
In this particular case the loss of precision is OK in practice, since the void * is being used to hold very small integers.
However, ptrdiff_t is still more appropriate and will always have sufficient precision to match void *; I will change the cast to that instead.
Thanks,
-mental
Hi,
On Sun, Nov 07, 2004 at 02:00:42PM -0500, MenTaLguY wrote: [snip]
Casting a void * to an int is probably a very bad thing to do. A void * is 64 bit on those arches while an int is 32 bit.
In this particular case the loss of precision is OK in practice, since the void * is being used to hold very small integers.
However, ptrdiff_t is still more appropriate and will always have sufficient precision to match void *; I will change the cast to that instead.
Thanks,
-mental
Thanks for fixing this. The problem here is not the lost precision, but that the build fails in all 64Bit architectures in debian unstable. Shall I open a bug on this in the tracker? I originally wanted to do that, but yesterday I was in a hurry so I just pressed the forward key in mutt.
With best regards,
Wolfi
On Mon, 2004-11-08 at 08:42, Wolfram Quester wrote:
Thanks for fixing this. The problem here is not the lost precision, but that the build fails in all 64Bit architectures in debian unstable.
Are the Debian packages built with -Werror? I wouldn't have expected it to be fatal. That said I will pay closer attention in the future...
Shall I open a bug on this in the tracker? I originally wanted to do that, but yesterday I was in a hurry so I just pressed the forward key in mutt.
This particular one's already been fixed in CVS, so there's not much point filing a bug for it now.
If there are other such issues in the codebase, please file a bug for each general area of code affected, indicating the individual places where such casts are made.
-mental
Hi Mental,
On Mon, Nov 08, 2004 at 11:25:33PM -0500, MenTaLguY wrote:
On Mon, 2004-11-08 at 08:42, Wolfram Quester wrote:
Thanks for fixing this. The problem here is not the lost precision, but that the build fails in all 64Bit architectures in debian unstable.
Are the Debian packages built with -Werror? I wouldn't have expected it to be fatal. That said I will pay closer attention in the future...
No, they aren't. You can have a look at the build-log on alpha at http://buildd.debian.org/fetch.php?&pkg=inkscape&ver=0.39%2B0.40pre1... There it says
CFLAGS="-Wall -g -O2" CXXFLAGS="-Wall -g -O2" ./configure --host=alpha-linux --build=alpha-linux --prefix=/usr --mandir=${prefix}/share/man --infodir=${prefix}/share/info
and later there is no -Werror in the gcc-call.
Shall I open a bug on this in the tracker? I originally wanted to do that, but yesterday I was in a hurry so I just pressed the forward key in mutt.
This particular one's already been fixed in CVS, so there's not much point filing a bug for it now.
If there are other such issues in the codebase, please file a bug for each general area of code affected, indicating the individual places where such casts are made.
OK, I'll try. The problem is I don't have any 64-Bit machine here to test. I'll build pre2 today an wait what the buildds say. I'll try to get acces to one of debian's machines available for developers.
-mental
Thanks,
Wolfi
participants (2)
-
MenTaLguY
-
Wolfram Quester