[Insight-developers] Help to debug on LInux64 and Mac 10.5

Sean McBride sean at rogue-research.com
Thu Dec 20 13:44:09 EST 2007


On 12/20/07 8:46 AM, Bill Lorensen said:

>It looks like the undefined behavior is only for signed integer overflow.
>Could you try something for us?
>
>In Code/Common/itkStructHashFunction.h, change the line:
>int hash = 0;
>to
>unsigned int hash = 0;
>
>and rerun the failing test.

That didn't fix it.  But I think that change is worth committing anyway,
as the function returns unsigned int.  We tried changing the hash
function to unsigned long also, but that changed nothing.

Mathieu and I looked at the code a bit... wow, templates! :)  So I tried
building the test with 64-to-32-bit conversion warnings on, and there
are many of them.  ITK in fact will need huge amounts of work to build
cleanly.

One thing we noticed was:

typedef unsigned long IdentifierType

Which makes IdentifierType 64 bit on 64 bit builds, and 32 bit on 32 bit
builds.  Perhaps other code is expecting IdentifierType to be int-sized
(ie 32 bit)...?

Anything else we can try?

-- 
____________________________________________________________
Sean McBride, B. Eng                 sean at rogue-research.com
Rogue Research                        www.rogue-research.com 
Mac Software Developer              Montréal, Québec, Canada



More information about the Insight-developers mailing list