Your message dated Thu, 10 Mar 2005 16:47:56 +0100 with message-id <[EMAIL PROTECTED]> has caused the Debian Bug report #297924, regarding ode: FTBFS (amd64/gcc-4.0): cast from 'Opcode::AABBTreeNode*' to 'udword' loses precision to be marked as having been forwarded to the upstream software author(s) Russel Smith <[EMAIL PROTECTED]>, Pierre Terdiman <[EMAIL PROTECTED]>.
(NB: If you are a system administrator and have no idea what I am talking about this indicates a serious mail system misconfiguration somewhere. Please contact me immediately.) Debian bug tracking system administrator (administrator, Debian Bugs database) --------------------------------------- Received: (at 297924-forwarded) by bugs.debian.org; 10 Mar 2005 15:48:02 +0000 >From [EMAIL PROTECTED] Thu Mar 10 07:48:02 2005 Return-path: <[EMAIL PROTECTED]> Received: from 214pc223.sshunet.nl [145.97.223.214] (root) by spohr.debian.org with esmtp (Exim 3.35 1 (Debian)) id 1D9PtJ-0001R2-00; Thu, 10 Mar 2005 07:48:01 -0800 Received: from xar.sliepen.oi ([EMAIL PROTECTED] [127.0.0.1]) by xar.sliepen.oi (8.13.3/8.13.3/Debian-8) with ESMTP id j2AFlvgO028790 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Thu, 10 Mar 2005 16:47:57 +0100 Received: (from [EMAIL PROTECTED]) by xar.sliepen.oi (8.13.3/8.13.3/Submit) id j2AFluBj028789; Thu, 10 Mar 2005 16:47:56 +0100 Date: Thu, 10 Mar 2005 16:47:56 +0100 From: Guus Sliepen <[EMAIL PROTECTED]> To: Russel Smith <[EMAIL PROTECTED]>, Pierre Terdiman <[EMAIL PROTECTED]> Cc: [EMAIL PROTECTED] Subject: [EMAIL PROTECTED]: Bug#297924: ode: FTBFS (amd64/gcc-4.0): cast from 'Opcode::AABBTreeNode*' to 'udword' loses precision] Message-ID: <[EMAIL PROTECTED]> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="4f28nU6agdXSinmL" Content-Disposition: inline X-oi: oi User-Agent: Mutt/1.5.6+20040907i Delivered-To: [EMAIL PROTECTED] X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2005_01_02 (1.212-2003-09-23-exp) on spohr.debian.org X-Spam-Status: No, hits=-6.0 required=4.0 tests=BAYES_00,HAS_BUG_NUMBER autolearn=no version=2.60-bugs.debian.org_2005_01_02 X-Spam-Level: --4f28nU6agdXSinmL Content-Type: multipart/mixed; boundary="UnaWdueM1EBWVRzC" Content-Disposition: inline --UnaWdueM1EBWVRzC Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hello Russel, Pierre, I am the maintainer of the Debian package of ODE. ODE contains a copy of Opcode 1.3. Lately more and more people need Opcode because they want to include triangle meshes in their simulations. Another recent development is that more and more people are starting to use 64-bit processors. However, in lots of places in Opcode's source, pointers are stored in udwords, which is typedeffed in Ice/IceTypes.h as an unsigned int. However, on most 64-bit platforms an int is still 32 bit, while pointers are 64 bit. This breaks Opcode. The attached bugreport suggests replacing casts from pointers to udwords with casts to long ints, however that is still as bad. I suggest: - storing pointers in variables of corresponding pointer types - using intptr_t and/or ptrdiff_t variables if you need to do pointer arithmetic Please also replace ubyte, sword, udword etc. with uint8_t, int16_t, uint32_t etc. from stdint.h, the latter types have been standardised and are guaranteed to have the correct size, while the former types are sure to break on some architecture. --=20 Met vriendelijke groet / with kind regards, Guus Sliepen <[EMAIL PROTECTED]> --UnaWdueM1EBWVRzC Content-Type: message/rfc822 Content-Disposition: inline Received: from spohr.debian.org ([EMAIL PROTECTED] [128.193.0.4]) by xar.sliepen.oi (8.13.3/8.13.3/Debian-7) with ESMTP id j23FstPM028115 for <[EMAIL PROTECTED]>; Thu, 3 Mar 2005 16:54:56 +0100 Received: from debbugs by spohr.debian.org with local (Exim 3.35 1 (Debian)) id 1D6sYV-000676-00; Thu, 03 Mar 2005 07:48:03 -0800 X-Loop: [EMAIL PROTECTED] Subject: Bug#297924: ode: FTBFS (amd64/gcc-4.0): cast from 'Opcode::AABBTreeNode*' to 'udword' loses precision Reply-To: Andreas Jochens <[EMAIL PROTECTED]>, [EMAIL PROTECTED] Resent-From: Andreas Jochens <[EMAIL PROTECTED]> Resent-To: debian-bugs-dist@lists.debian.org Resent-CC: Guus Sliepen <[EMAIL PROTECTED]> Resent-Date: Thu, 03 Mar 2005 15:48:01 UTC Resent-Message-ID: <[EMAIL PROTECTED]> X-Debian-PR-Message: report 297924 X-Debian-PR-Package: ode X-Debian-PR-Keywords: patch Received: via spool by [EMAIL PROTECTED] id=B.110986208332501 (code B ref -1); Thu, 03 Mar 2005 15:48:01 UTC Received: (at submit) by bugs.debian.org; 3 Mar 2005 15:01:23 +0000 Received: from c223012.adsl.hansenet.de (localhost.localdomain) [213.39.223.12] by spohr.debian.org with esmtp (Exim 3.35 1 (Debian)) id 1D6rpL-0008Rh-00; Thu, 03 Mar 2005 07:01:23 -0800 Received: from aj by localhost.localdomain with local (Exim 4.44) id 1D6sld-0006gq-PO; Thu, 03 Mar 2005 17:01:39 +0100 To: Debian Bug Tracking System <[EMAIL PROTECTED]> From: Andreas Jochens <[EMAIL PROTECTED]> Message-Id: <[EMAIL PROTECTED]> Date: Thu, 03 Mar 2005 17:01:39 +0100 Delivered-To: [EMAIL PROTECTED] X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2005_01_02 (1.212-2003-09-23-exp) on spohr.debian.org X-Spam-Status: No, hits=-8.0 required=4.0 tests=BAYES_00,HAS_PACKAGE autolearn=no version=2.60-bugs.debian.org_2005_01_02 X-Spam-Level: Resent-Sender: Debian BTS <[EMAIL PROTECTED]> Package: ode Severity: normal Tags: patch When building 'ode' on amd64 with gcc-4.0, I get the following error: OPCODE/OPC_AABBTree.cpp: In member function 'bool Opcode::AABBTreeNode::Subdivide(Opcode::AABBTreeBuilder*)': OPCODE/OPC_AABBTree.cpp:295: error: cast from 'Opcode::AABBTreeNode*' to 'udword' loses precision OPCODE/OPC_AABBTree.cpp:309: error: cast from 'Opcode::AABBTreeNode*' to 'udword' loses precision OPCODE/OPC_AABBTree.h: In constructor 'Opcode::AABBTree::AABBTree()': OPCODE/OPC_AABBTree.h:134: warning: 'Opcode::AABBTree::mTotalNbNodes' will be initialized after OPCODE/OPC_AABBTree.h:132: warning: 'Opcode::AABBTreeNode* Opcode::AABBTree::mPool' OPCODE/OPC_AABBTree.cpp:373: warning: when initialized here make[1]: *** [OPCODE/OPC_AABBTree.o] Error 1 make[1]: Leaving directory `/ode-0.5' make: *** [build-stamp] Error 2 With the attached patch 'ode' can be compiled on amd64 using gcc-4.0. Regards Andreas Jochens diff -urN ../tmp-orig/ode-0.5/OPCODE/OPC_AABBTree.cpp ./OPCODE/OPC_AABBTree.cpp --- ../tmp-orig/ode-0.5/OPCODE/OPC_AABBTree.cpp 2003-07-01 08:58:47.000000000 +0200 +++ ./OPCODE/OPC_AABBTree.cpp 2005-03-03 16:39:52.000000000 +0100 @@ -290,11 +290,11 @@ AABBTreeNode* Pool = (AABBTreeNode*)builder->mNodeBase; udword Count = builder->GetCount() - 1; // Count begins to 1... // Set last bit to tell it shouldn't be freed ### pretty ugly, find a better way. Maybe one bit in mNbPrimitives - ASSERT(!(udword(&Pool[Count+0])&1)); - ASSERT(!(udword(&Pool[Count+1])&1)); - mPos = udword(&Pool[Count+0])|1; + ASSERT(!(long(&Pool[Count+0])&1)); + ASSERT(!(long(&Pool[Count+1])&1)); + mPos = long(&Pool[Count+0])|1; #ifndef OPC_NO_NEG_VANILLA_TREE - mNeg = udword(&Pool[Count+1])|1; + mNeg = long(&Pool[Count+1])|1; #endif } else @@ -306,7 +306,7 @@ #else AABBTreeNode* PosNeg = new AABBTreeNode[2]; CHECKALLOC(PosNeg); - mPos = (udword)PosNeg; + mPos = (long)PosNeg; #endif } diff -urN ../tmp-orig/ode-0.5/OPCODE/OPC_HybridModel.cpp ./OPCODE/OPC_HybridModel.cpp --- ../tmp-orig/ode-0.5/OPCODE/OPC_HybridModel.cpp 2003-07-01 08:58:47.000000000 +0200 +++ ./OPCODE/OPC_HybridModel.cpp 2005-03-03 16:40:13.000000000 +0100 @@ -209,7 +209,7 @@ Data->mLeaves[Data->mNbLeaves] = *current->GetAABB(); // Setup leaf data - udword Index = (udword(current->GetPrimitives()) - udword(Data->mBase))/sizeof(udword); + udword Index = (long(current->GetPrimitives()) - long(Data->mBase))/sizeof(udword); Data->mTriangles[Data->mNbLeaves].SetData(current->GetNbPrimitives(), Index); Data->mNbLeaves++; diff -urN ../tmp-orig/ode-0.5/OPCODE/OPC_OptimizedTree.cpp ./OPCODE/OPC_OptimizedTree.cpp --- ../tmp-orig/ode-0.5/OPCODE/OPC_OptimizedTree.cpp 2003-07-01 08:58:47.000000000 +0200 +++ ./OPCODE/OPC_OptimizedTree.cpp 2005-03-03 16:44:51.360640448 +0100 @@ -119,7 +119,7 @@ udword PosID = current_id++; // Get a new id for positive child udword NegID = current_id++; // Get a new id for negative child // Setup box data as the forthcoming new P pointer - linear[box_id].mData = (udword)&linear[PosID]; + linear[box_id].mData = (long)&linear[PosID]; // Make sure it's not marked as leaf ASSERT(!(linear[box_id].mData&1)); // Recurse with new IDs @@ -172,7 +172,7 @@ // Get a new id for positive child udword PosID = current_id++; // Setup box data - linear[box_id].mPosData = (udword)&linear[PosID]; + linear[box_id].mPosData = (long)&linear[PosID]; // Make sure it's not marked as leaf ASSERT(!(linear[box_id].mPosData&1)); // Recurse @@ -193,7 +193,7 @@ // Get a new id for negative child udword NegID = current_id++; // Setup box data - linear[box_id].mNegData = (udword)&linear[NegID]; + linear[box_id].mNegData = (long)&linear[NegID]; // Make sure it's not marked as leaf ASSERT(!(linear[box_id].mNegData&1)); // Recurse @@ -550,8 +550,8 @@ if(!(Data&1)) \ { \ /* Compute box number */ \ - udword Nb = (Data - udword(Nodes))/Nodes[i].GetNodeSize(); \ - Data = udword(&mNodes[Nb]); \ + long Nb = (Data - long(Nodes))/Nodes[i].GetNodeSize(); \ + Data = long(&mNodes[Nb]); \ } \ /* ...remapped */ \ mNodes[i].member = Data; diff -urN ../tmp-orig/ode-0.5/OPCODE/OPC_SweepAndPrune.cpp ./OPCODE/OPC_SweepAndPrune.cpp --- ../tmp-orig/ode-0.5/OPCODE/OPC_SweepAndPrune.cpp 2003-07-01 08:58:47.000000000 +0200 +++ ./OPCODE/OPC_SweepAndPrune.cpp 2005-03-03 16:45:50.795168488 +0100 @@ -164,7 +164,7 @@ /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// inline_ void Remap(SAP_Element*& element, udword delta) { - if(element) element = (SAP_Element*)(udword(element) + delta); + if(element) element = (SAP_Element*)(long(element) + delta); } /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -200,7 +200,7 @@ // Remap everything { - udword Delta = udword(NewElems) - udword(mElementPool); + udword Delta = long(NewElems) - long(mElementPool); for(udword i=0;i<mNbUsedElements;i++) Remap(NewElems[i].mNext, Delta); for(udword i=0;i<mNbObjects;i++) Remap(mArray[i], Delta); diff -urN ../tmp-orig/ode-0.5/ode/test/test_space.cpp ./ode/test/test_space.cpp --- ../tmp-orig/ode-0.5/ode/test/test_space.cpp 2004-04-22 22:38:51.000000000 +0200 +++ ./ode/test/test_space.cpp 2005-03-03 16:52:41.556883898 +0100 @@ -123,15 +123,15 @@ static void nearCallback (void *data, dGeomID o1, dGeomID o2) { - int i,j; - i = (int) dGeomGetData (o1); - j = (int) dGeomGetData (o2); + long i,j; + i = (long) dGeomGetData (o1); + j = (long) dGeomGetData (o2); if (i==j) - printf ("collision (%d,%d) is between the same object\n",i,j); + printf ("collision (%ld,%ld) is between the same object\n",i,j); if (!good_matrix[i][j] || !good_matrix[j][i]) - printf ("collision (%d,%d) is incorrect\n",i,j); + printf ("collision (%ld,%ld) is incorrect\n",i,j); if (test_matrix[i][j] || test_matrix[j][i]) - printf ("collision (%d,%d) reported more than once\n",i,j); + printf ("collision (%ld,%ld) reported more than once\n",i,j); test_matrix[i][j] = 1; test_matrix[j][i] = 1; } --UnaWdueM1EBWVRzC-- --4f28nU6agdXSinmL Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) iD8DBQFCMGwrAxLow12M2nsRAkB3AKCnJ/k6NZVeO9kvnYbOwltZw1ZfGgCcDB/k uAeVDE3epeahNHn1VWumzOo= =UVgO -----END PGP SIGNATURE----- --4f28nU6agdXSinmL-- -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]