[osg-users] osgviewerCocoa build error with clang 7.0.0

Ravi Mathur ravidavi at utexas.edu
Thu Nov 5 18:05:09 PST 2015


Hi all,

The osgviewerCocoa example gives the following error during build:


Code:

ViewerCocoa.mm:176:9: error: 
cast from pointer to smaller type 'NSOpenGLPixelFormatAttribute'
(aka 'unsigned int') loses information 
(NSOpenGLPixelFormatAttribute)nil
^~~~~~~~~~~~~~~~~~~~~~




This occurs on the OpenSceneGraph-3.4 branch of the Git repo, using OSX 10.10.5 with the latest Command Line Tools (clang 7.0.0).

According to Apple's NSOpenGLPixelFormat reference (can't post url since this is my first post), the last element of the NSOpenGLPixelFormatAttribute array should be 0 (zero), not (NSOpenGLPixelFormatAttribute)nil . The new clang is strict about this, so throws an error.

Thanks!
Ravi

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=65557#65557








More information about the osg-users mailing list