[Insight-developers] Re: MacOS Warnings 64bits to 32bits truncation : At end of Files ???

Mathieu Coursolle mcoursolle at rogue-research.com
Mon Jan 28 13:55:29 EST 2008


However, if the header is fixed, the "At global scope" part of the warnings
is still visible.

Removing the GLIBCXX_DEBUG and GLIBCXX_DEBUG_PEDANTIC flags will however 
make this warning disappear.

MAthieu 

>Hi,
>
>I've build ITK in 64 bits and could repro those warnings.
>
>Ex:
>
>/Developer/SDKs/MacOSX10.5.sdk/usr/include/c++/4.0.0/bits/
>basic_string.h: In member function 'int std::basic_string<_CharT,
>_Traits, _Alloc>::compare(const std::basic_string<_CharT, _Traits,
>_Alloc>&) const [with _CharT = char, _Traits = std::char_traits<char>,
>_Alloc = std::allocator<char>]':
>/Developer/SDKs/MacOSX10.5.sdk/usr/include/c++/4.0.0/bits/basic_string.h:
>2116:   instantiated from 'bool std::operator==(const
>std::basic_string<_CharT, _Traits, _Alloc>&, const
>std::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char,
>_Traits = std::char_traits<char>, _Alloc = std::allocator<char>]'
>/Volumes/Extra/Kitware/ITK/Latest/Insight/Code/Common/
>itkExceptionObject.h:104:   instantiated from here
>/Developer/SDKs/MacOSX10.5.sdk/usr/include/c++/4.0.0/bits/basic_string.h:
>1921: warning: implicit conversion shortens 64-bit value into a 32-bit value
>/Volumes/Extra/Kitware/ITK/Latest/Insight/Code/IO/itkAnalyzeImageIO.cxx:
>At global scope:
>/Volumes/Extra/Kitware/ITK/Latest/Insight/Code/IO/itkAnalyzeImageIO.cxx:
>1537: warning: implicit conversion shortens 64-bit value into a 32-bit value
>/Volumes/Extra/Kitware/ITK/Latest/Insight/Code/IO/itkAnalyzeImageIO.cxx:
>1537: warning: implicit conversion shortens 64-bit value into a 32-bit value
>/Volumes/Extra/Kitware/ITK/Latest/Insight/Code/IO/itkAnalyzeImageIO.cxx:
>1537: warning: implicit conversion shortens 64-bit value into a 32-bit value
>/Volumes/Extra/Kitware/ITK/Latest/Insight/Code/IO/itkAnalyzeImageIO.cxx:
>1537: warning: implicit conversion shortens 64-bit value into a 32-bit value
>/Volumes/Extra/Kitware/ITK/Latest/Insight/Code/IO/itkAnalyzeImageIO.cxx:
>1537: warning: implicit conversion shortens 64-bit value into a 32-bit value
>/Volumes/Extra/Kitware/ITK/Latest/Insight/Code/IO/itkAnalyzeImageIO.cxx:
>1537: warning: implicit conversion shortens 64-bit value into a 32-bit value
>/Volumes/Extra/Kitware/ITK/Latest/Insight/Code/IO/itkAnalyzeImageIO.cxx:
>1537: warning: implicit conversion shortens 64-bit value into a 32-bit value
>/Volumes/Extra/Kitware/ITK/Latest/Insight/Code/IO/itkAnalyzeImageIO.cxx:
>1537: warning: implicit conversion shortens 64-bit value into a 32-bit value
>/Volumes/Extra/Kitware/ITK/Latest/Insight/Code/IO/itkAnalyzeImageIO.cxx:
>1538: warning: implicit conversion shortens 64-bit value into a 32-bit value
>/Volumes/Extra/Kitware/ITK/Latest/Insight/Code/IO/itkAnalyzeImageIO.cxx:
>1538: warning: implicit conversion shortens 64-bit value into a 32-bit value
>/Volumes/Extra/Kitware/ITK/Latest/Insight/Code/IO/itkAnalyzeImageIO.cxx:
>1538: warning: implicit conversion shortens 64-bit value into a 32-bit value
>/Volumes/Extra/Kitware/ITK/Latest/Insight/Code/IO/itkAnalyzeImageIO.cxx:
>1538: warning: implicit conversion shortens 64-bit value into a 32-bit value
>
>From what I see, this function from Apple headers seems to be the guilty
>piece of code.
>__size is 64 bits in 64 bits architectures, while __r is 32:
>basic_string.h:1921
>
>int
>      compare(const basic_string& __str) const
>      {
>	const size_type __size = this->size();
>	const size_type __osize = __str.size();
>	const size_type __len = std::min(__size, __osize);
>
>	int __r = traits_type::compare(_M_data(), __str.data(), __len);
>	if (!__r)
>	  __r =  __size - __osize;
>	return __r;
>      }
>
>Mathieu
>
>>http://www.itk.org/Testing/Sites/RogueResearch3/Mac10.5-InsightReview-
>>gcc-dbg-ppc64/20080126-0100-Nightly/BuildWarning.html
>_______________________________________________
>Insight-developers mailing list
>Insight-developers at itk.org
>http://www.itk.org/mailman/listinfo/insight-developers
>



More information about the Insight-developers mailing list