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

Bill Lorensen bill.lorensen at gmail.com
Mon Jan 28 14:10:04 EST 2008


I'd hate to see the GLIBCXX_DEBUG and GLIBCXX_DEBUG_PEDANTIC flags removed.
They catch iterator and container errors. Perhaps you can enable the 64bit
warning on one platform and the GLIBCXX flags on another?

Bill

On Jan 28, 2008 1:55 PM, Mathieu Coursolle <mcoursolle at rogue-research.com>
wrote:

> 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
> >
>
> _______________________________________________
> Insight-developers mailing list
> Insight-developers at itk.org
> http://www.itk.org/mailman/listinfo/insight-developers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.itk.org/mailman/private/insight-developers/attachments/20080128/98754dd5/attachment.html


More information about the Insight-developers mailing list