Hi,

On Thursday 22 March 2012, Ulrich Hertlein wrote:
> On 13/03/12 4:43 , Stephan Maximilian Huber wrote:
> > it seems that compiling osg and specifically OpenThreads is currently
> > broken for IOS when using xcode 4.3.1. The compilation fails at
> > OpenThreads/Atomic with
> >
> > Users/stephan/Documents/Projekte/cefix/cefix/ios/../../libs/ios/include/O
> >penThreads/Atomic:244:48: error: cannot initialize a parameter of type
> > 'void *' with an lvalue of type 'const void *const'
> >     return __sync_bool_compare_and_swap(&_ptr, ptrOld, ptrNew);
> >
> > Googling around it seems, that this is because of a bug in the
> > clang-compiler: http://llvm.org/bugs/show_bug.cgi?id=11280
> >
> > Has anybody an idea how to fix the issue? In the meantime i'll switch to
> > _OPENTHREADS_ATOMIC_USE_MUTEX
>
> This recently broke for me on OS X (with clang 3.1) as well.  Casting
> 'ptrOld' to (void*) works and this is also done for the other
> implementations (WIN32_INTERLOCKED and BSD_ATOMIC) as well.
>
> No ideal, both 'ptrOld' and 'ptrNew' are only read and could actually both
> be const but aren't for some reason.

Casting this is probably ok. It boils down to the question if gcc accepts the 
casted version that clang needs or if gcc then fails with a similar problem.

If you can make sure that gcc's like the cast variant, replace it. If not 
provide an alternative ifdef that sorts out if you are runnung clang or not.

Greetings

Mathias

-- 
Dr. Mathias Fröhlich, science + computing ag, Software Solutions
Hagellocher Weg 71-75, D-72070 Tuebingen, Germany
Phone: +49 7071 9457-268, Fax: +49 7071 9457-511
-- 
Vorstandsvorsitzender/Chairman of the board of management:
Gerd-Lothar Leonhart
Vorstand/Board of Management:
Dr. Bernd Finkbeiner, Michael Heinrichs, 
Dr. Arno Steitz, Dr. Ingrid Zech
Vorsitzender des Aufsichtsrats/
Chairman of the Supervisory Board:
Philippe Miltin
Sitz/Registered Office: Tuebingen
Registergericht/Registration Court: Stuttgart
Registernummer/Commercial Register No.: HRB 382196

_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to