HI Erik,

On 19 March 2012 22:20, Erik den Dekker <[email protected]> wrote:
> using clang I received several warnings like:
>
> [ 8%] Building CXX object src/osg/CMakeFiles/osg.dir/State.cpp.o
> /Users/erik/Projects/OpenSceneGraph/OpenSceneGraph-SVN/src/osg/State.cpp:1166:57:
> warning: use of logical '||' with constant operand
> [-Wconstant-logical-operand]
> _isVertexBufferObjectSupported = OSG_GLES2_FEATURES || OSG_GL3_FEATURES ||
> osg::isGLExtensionSupported(_contextID,"GL_ARB_vertex_buffer_object");
> ^ ~~~~~~~~~~~~~~~~
> /Users/erik/Projects/OpenSceneGraph/OpenSceneGraph-SVN/src/osg/State.cpp:1166:57:
> note: use '|' for a bitwise operation
> _isVertexBufferObjectSupported = OSG_GLES2_FEATURES || OSG_GL3_FEATURES ||
> osg::isGLExtensionSupported(_contextID,"GL_ARB_vertex_buffer_object");
> ^~
> |
> 1 warning generated.

The clang warning you've "fixed" is pretty dumb and the changes are
extensive and for me are less readable.  Coding wise there are
completely pointless, the original code is in no way ambiguous, so I'm
rejecting the submission.  If you want to fix the warning then the
most appropriate thing to do would be to disable the stupid warning.

> There is still a similar warning that points to a fishy piece of code in the
> DXF plugin:
>
> [ 75%] Building CXX object
> src/osgPlugins/dxf/CMakeFiles/osgdb_dxf.dir/dxfEntity.cpp.o
> /Users/erik/Projects/OpenSceneGraph/OpenSceneGraph-SVN/src/osgPlugins/dxf/dxfEntity.cpp:410:22:
> warning: use of logical '&&' with constant operand
> [-Wconstant-logical-operand]
> (cv._int && 128 /*i.e. vertex is actually a face*/))
> ^ ~~~
> /Users/erik/Projects/OpenSceneGraph/OpenSceneGraph-SVN/src/osgPlugins/dxf/dxfEntity.cpp:410:22:
> note: use '&' for a bitwise operation
> (cv._int && 128 /*i.e. vertex is actually a face*/))
> ^~
> &
> /Users/erik/Projects/OpenSceneGraph/OpenSceneGraph-SVN/src/osgPlugins/dxf/dxfEntity.cpp:410:22:
> note: remove constant to silence this warning
> (cv._int && 128 /*i.e. vertex is actually a face*/))
> ^~~~~~
> 1 warning generated.
>
>
> But I am not sure what the correct code would be,.. (Use & instead of
> &&?),.. So a fix is not included here.

This looks to be a genuine error and the appropriate fix is to use a
&.  This fix is now checked into svn/trunk.

Thanks,
Robert.
_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

Reply via email to