[ITK-dev] [ITK] Clang compile error
Matt McCormick
matt.mccormick at kitware.com
Sun Nov 1 14:15:55 EST 2015
Hi Bill,
What is the OSX / Clang / Xcode version?
Thanks,
Matt
On Sun, Nov 1, 2015 at 11:21 AM, Bill Lorensen <bill.lorensen at gmail.com> wrote:
> On my Mac clang build I get this:
> In file included from
> /Users/lorensen/ProjectsGIT/ITK/Modules/Core/Common/test/itkAtomicIntTest.cxx:32:
> In file included from
> /Users/lorensen/ProjectsGIT/ITK/Modules/Core/Common/include/itkAtomicInt.h:42:
> /Users/lorensen/ProjectsGIT/ITK/Modules/Core/Common/include/itkAtomicIntDetail.h:90:33:
> error: cannot initialize a parameter of type
> 'volatile int *' with an lvalue of type 'ValueType *' (aka 'long long *')
> return __sync_add_and_fetch(ref, 1);
> ^~~
> /Users/lorensen/ProjectsGIT/ITK/Modules/Core/Common/include/itkAtomicInt.h:93:33:
> note: in instantiation of member function
> 'itk::Detail::AtomicOps<8>::PreIncrement' requested here
> return static_cast<T>(Impl::PreIncrement(&this->m_Object));
> ^
> /Users/lorensen/ProjectsGIT/ITK/Modules/Core/Common/test/itkAtomicIntTest.cxx:62:11:
> note: in instantiation of member function
> 'itk::AtomicInt<unsigned long long>::operator++' requested here
> idx = ++TotalAtomic64;
> ^
> In file included from
> /Users/lorensen/ProjectsGIT/ITK/Modules/Core/Common/test/itkAtomicIntTest.cxx:32:
> In file included from
> /Users/lorensen/ProjectsGIT/ITK/Modules/Core/Common/include/itkAtomicInt.h:42:
> /Users/lorensen/ProjectsGIT/ITK/Modules/Core/Common/include/itkAtomicIntDetail.h:95:33:
> error: cannot initialize a parameter of type
> 'volatile int *' with an lvalue of type 'ValueType *' (aka 'long long *')
> return __sync_sub_and_fetch(ref, 1);
> ^~~
> /Users/lorensen/ProjectsGIT/ITK/Modules/Core/Common/include/itkAtomicInt.h:103:33:
> note: in instantiation of member function
> 'itk::Detail::AtomicOps<8>::PreDecrement' requested here
> return static_cast<T>(Impl::PreDecrement(&this->m_Object));
> ^
> /Users/lorensen/ProjectsGIT/ITK/Modules/Core/Common/test/itkAtomicIntTest.cxx:77:5:
> note: in instantiation of member function
> 'itk::AtomicInt<unsigned long long>::operator--' requested here
> --TotalAtomic64;
> ^
> In file included from
> /Users/lorensen/ProjectsGIT/ITK/Modules/Core/Common/test/itkAtomicIntTest.cxx:32:
> In file included from
> /Users/lorensen/ProjectsGIT/ITK/Modules/Core/Common/include/itkAtomicInt.h:42:
> /Users/lorensen/ProjectsGIT/ITK/Modules/Core/Common/include/itkAtomicIntDetail.h:80:33:
> error: cannot initialize a parameter of type
> 'volatile int *' with an lvalue of type 'ValueType *' (aka 'long long *')
> return __sync_add_and_fetch(ref, val);
> ^~~
> /Users/lorensen/ProjectsGIT/ITK/Modules/Core/Common/include/itkAtomicInt.h:113:33:
> note: in instantiation of member function
> 'itk::Detail::AtomicOps<8>::AddAndFetch' requested here
> return static_cast<T>(Impl::AddAndFetch(&this->m_Object,
> ^
> /Users/lorensen/ProjectsGIT/ITK/Modules/Core/Common/test/itkAtomicIntTest.cxx:90:25:
> note: in instantiation of member function
> 'itk::AtomicInt<unsigned long long>::operator+=' requested here
> idx = TotalAtomic64 += 1;
> ^
> In file included from
> /Users/lorensen/ProjectsGIT/ITK/Modules/Core/Common/test/itkAtomicIntTest.cxx:32:
> In file included from
> /Users/lorensen/ProjectsGIT/ITK/Modules/Core/Common/include/itkAtomicInt.h:42:
> /Users/lorensen/ProjectsGIT/ITK/Modules/Core/Common/include/itkAtomicIntDetail.h:100:33:
> error: cannot initialize a parameter of type
> 'volatile int *' with an lvalue of type 'ValueType *' (aka 'long long *')
> return __sync_fetch_and_add(ref, 1);
> ^~~
> /Users/lorensen/ProjectsGIT/ITK/Modules/Core/Common/include/itkAtomicInt.h:98:33:
> note: in instantiation of member function
> 'itk::Detail::AtomicOps<8>::PostIncrement' requested here
> return static_cast<T>(Impl::PostIncrement(&this->m_Object));
> ^
> /Users/lorensen/ProjectsGIT/ITK/Modules/Core/Common/test/itkAtomicIntTest.cxx:106:18:
> note: in instantiation of member function
> 'itk::AtomicInt<unsigned long long>::operator++' requested here
> TotalAtomic64++;
> ^
> In file included from
> /Users/lorensen/ProjectsGIT/ITK/Modules/Core/Common/test/itkAtomicIntTest.cxx:32:
> In file included from
> /Users/lorensen/ProjectsGIT/ITK/Modules/Core/Common/include/itkAtomicInt.h:42:
> /Users/lorensen/ProjectsGIT/ITK/Modules/Core/Common/include/itkAtomicIntDetail.h:105:33:
> error: cannot initialize a parameter of type
> 'volatile int *' with an lvalue of type 'ValueType *' (aka 'long long *')
> return __sync_fetch_and_sub(ref, 1);
> ^~~
> /Users/lorensen/ProjectsGIT/ITK/Modules/Core/Common/include/itkAtomicInt.h:108:33:
> note: in instantiation of member function
> 'itk::Detail::AtomicOps<8>::PostDecrement' requested here
> return static_cast<T>(Impl::PostDecrement(&this->m_Object));
> ^
> /Users/lorensen/ProjectsGIT/ITK/Modules/Core/Common/test/itkAtomicIntTest.cxx:108:18:
> note: in instantiation of member function
> 'itk::AtomicInt<unsigned long long>::operator--' requested here
> TotalAtomic64--;
> ^
> In file included from
> /Users/lorensen/ProjectsGIT/ITK/Modules/Core/Common/test/itkAtomicIntTest.cxx:32:
> In file included from
> /Users/lorensen/ProjectsGIT/ITK/Modules/Core/Common/include/itkAtomicInt.h:42:
> /Users/lorensen/ProjectsGIT/ITK/Modules/Core/Common/include/itkAtomicIntDetail.h:85:33:
> error: cannot initialize a parameter of type
> 'volatile int *' with an lvalue of type 'ValueType *' (aka 'long long *')
> return __sync_sub_and_fetch(ref, val);
> ^~~
> /Users/lorensen/ProjectsGIT/ITK/Modules/Core/Common/include/itkAtomicInt.h:119:33:
> note: in instantiation of member function
> 'itk::Detail::AtomicOps<8>::SubAndFetch' requested here
> return static_cast<T>(Impl::SubAndFetch(&this->m_Object,
> ^
> /Users/lorensen/ProjectsGIT/ITK/Modules/Core/Common/test/itkAtomicIntTest.cxx:109:19:
> note: in instantiation of member function
> 'itk::AtomicInt<unsigned long long>::operator-=' requested here
> TotalAtomic64 -= 1;
> ^
> 6 errors generated.
> make[2]: *** [Modules/Core/Common/test/CMakeFiles/ITKCommon2TestDriver.dir/itkAtomicIntTest.cxx.o]
> Error 1
> make[1]: *** [Modules/Core/Common/test/CMakeFiles/ITKCommon2TestDriver.dir/all]
> Error 2
> make: *** [all] Error 2
> [ITK-clang]
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://kitware.com/products/protraining.php
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/insight-developers
> _______________________________________________
> Community mailing list
> Community at itk.org
> http://public.kitware.com/mailman/listinfo/community
More information about the Insight-developers
mailing list