[Insight-developers] Analyze writer header size incorrect on 64-bit system

Sean McBride sean at rogue-research.com
Tue Jul 24 12:13:59 EDT 2007


On 7/24/07 10:42 AM, kent williams said:

>It dumps out the relevant offsets and sizes of all the header fields, both
>for the Analyze and NIfTI headers.
>
>If I run the following on OSX:
>
>g++ -o analyseHeaderLayout analyseHeaderLayout.cxx
>g++ -m64 -o analyseHeaderLayout64 analyseHeaderLayout.cxx
>./analyseHeaderLayout > 32Bit_Output
>./analyseHeaderLayout64 > 64Bit_Output
>diff 32Bit_Output 64Bit_Output
>
>I get these results:
>
>5c5
><     sizeof(long) = 4
>---
>>     sizeof(long) = 8
>
>Which is what you want to see < the only difference between compiling 32 and
>64 bit is the size of a long.

On Mac OS X, yes, that is the major difference; there are others though:
<http://developer.apple.com/documentation/Darwin/Conceptual/64bitPorting/
transition/chapter_3_section_3.html>

In any case, the struct has no 'longs' so one 'lucks out' on Mac OS X. 
But on other systems 'int' is also 64 bit, and this code will be
horribly broken there.

-- 
____________________________________________________________
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