Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 429646

Summary: dev-games/openscenegraph-3.0.1 with sys-devel/clang-3.1 - 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);
Product: Gentoo Linux Reporter: Michael Seifert <m.seifert>
Component: [OLD] GamesAssignee: Maciej Mrozowski <reavertm>
Status: RESOLVED OBSOLETE    
Severity: normal CC: games
Priority: Normal Keywords: PATCH
Version: unspecified   
Hardware: All   
OS: Linux   
URL: http://lists.openscenegraph.org/pipermail/osg-submissions-openscenegraph.org/2012-March/009206.html
See Also: http://llvm.org/bugs/show_bug.cgi?id=11280
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: Backport of an OpenSceneGraph patch to work with LLVM/Clang 3.1
Patch for the ebuild dev-games/openscenegraph-3.0.1.ebuild

Description Michael Seifert 2012-08-03 13:56:24 UTC
Created attachment 320174 [details, diff]
Backport of an OpenSceneGraph patch to work with LLVM/Clang 3.1

It turns out that when using clang-3.1 to compile a minimal application which depends on openscenegraph-3.0.1, you get the following error message[1]:

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);

This seems to be a clang bug[2]. This bug can be circumvented with a patch for openscenegraph suggested by Ulrich Hertlein[1] which went upstream.

The patch for the header file and for the ebuild is attached. Applying these two worked for me.

Kind Regards,
Michael Seifert

[1] http://lists.openscenegraph.org/pipermail/osg-submissions-openscenegraph.org/2012-March/009206.html
[2] http://llvm.org/bugs/show_bug.cgi?id=11280
Comment 1 Michael Seifert 2012-08-03 13:58:31 UTC
Created attachment 320176 [details, diff]
Patch for the ebuild dev-games/openscenegraph-3.0.1.ebuild
Comment 2 Jeroen Roovers (RETIRED) gentoo-dev 2012-08-04 00:28:52 UTC
Comment on attachment 320176 [details, diff]
Patch for the ebuild dev-games/openscenegraph-3.0.1.ebuild

${PN}-${PV} should be simply written as ${P}.
Comment 3 Maciej Mrozowski gentoo-dev 2015-07-14 17:41:17 UTC
Already in 3.2.1