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

Sean McBride sean at rogue-research.com
Tue Jul 24 11:03:54 EDT 2007


On 7/24/07 8:58 AM, Hans Johnson said:

>bytes long.  The hdr is a struct that only contains:
>
>int
>char
>short int
>float
>
>types in a structure, and these types should have consistent length on both
>64 and 32 bit machines.

I'm afraid that is absolutely not true.  The C and C++ languages do not
even require them to be a specific size on even the same machine.  You
can find many many discussions of this on the net.  One top google hit:
<http://home.att.net/~jackklein/c/inttypes.html>

C99 provides <stdint.h> which contains types like uint8_t that are
guaranteed to be an exact size.  Alas, not all compilers have this
header, and I don't believe ITK uses this technique.  I'm not sure what
ITK does, but VTK defines its own types, such as vtkTypeUInt16, that
should be used when you need an exact size.

I took a quick look at Utilities/itkExtHdrs/itkAnalyzeDbh.h, and it
looks absolutely non-portable to me.  

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