[Insight-developers] Windows 64 bits & unsigned long

Sean McBride sean at rogue-research.com
Thu Nov 12 19:32:32 EST 2009


On 11/12/09 10:27 AM, Bradley Lowekamp said:

>1) I believe CDash is suppressing the warning generated by Wshorten-64-
>to-32 warning.

Are you thinking of ITK_USE_64BITS_APPLE_TRUNCATION_WARNING?

>Also the standard practice has been to add static_cast to suppress this
>kind of warning. It is so standard that I bet it has sometimes been done
>with out thought

No bet here. :)  I was lucky to start a new codebase and we turned on -
Wshorten-64-to-32 from the start.  It's not too hard to write code that
builds cleanly with it.  The occasional cast is unfortunately needed,
but that's life with C/C++.

Updating an existing codebase to build cleanly with Wshorten-64-to-32 is
probably a PITA.  But the warning is great for finding genuine errors.



On 11/12/09 4:56 PM, Gaëtan Lehmann said:

>      -xport64[=v]
>                Use this option to help you port code to a 64-bit
>                environment. Specifically, this option warns
>                against problems such as truncation of types
>                (including pointers), sign extension, and changes
>                to bit-packing that are common when you port code
>                from a 32-bit architecture such as V8 to a 64-bit
>                architecture such as V9.

That sounds great too!

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