[Insight-developers] VS 7.0 versus VS 7.1

Brad King brad.king at kitware.com
Fri May 6 10:41:12 EDT 2005


Hello,

This is entertaining.  Yesterday I was asked to find why VS 7.0 was 
crashing:

http://www.itk.org/Testing/Sites/terminus.kitware/WinXP-VC70/20050505-0500-Nightly/BuildError.html

I narrowed the problem down to a small test case which I documented here:

http://www.itk.org/Wiki/ITK_FAQ#Visual_Studio_7_.NET_2002_Compiler_Issues

Then I committed the work-around to the primary template of 
itk::NumericTraits.  This prevents VS 7.0 from crashing.  Now instead we 
get these errors on VS 7.1:

http://www.itk.org/Testing/Sites/dash11.kitware/Win32-vs71/20050506-0500-Nightly/BuildError.html

which I just narrowed down to the fact that that extra RealType 
definition was added to the unused primary template of NumericTraits! 
The best part is that we have specializations of NumericTraits for every 
numerical type we use, so the primary template should never be 
referenced by a compiler at all :)

The work-around now looks like this:

   // This primary template is never used but we need this definition
   // to avoid an ICE on VS 7.0.  This definition cannot be present for
   // VS 7.1 though or it generates bogus errors.
#if defined(_MSC_VER) && _MSC_VER == 1300
   /** Type for real-valued operations.  */
   typedef double RealType;
#endif

Hopefully that will fix both problems...

-Brad


More information about the Insight-developers mailing list