On Thu, Jun 23, 2011 at 11:46 AM, Robert Osfield
<[email protected]>wrote:

> Hi Ryan,
>
> As I could easily get clang compiling I did a scan through your log
> and have concluded that almost all the warnings are either false
> positives, i.e. NodeVisitor,  or not critical such as unused
> parameters.
>
> In two cases I spotted genuine problems
> osg::OcclusionQueryNode::releaseGLObjects(..) wasn't const when it
> should have been, and osgViewer::Viewer::take(View) should have
> qualified the View's namespace to make sure it overloaded the take
> method correctly.  I've fixed this two problems and checked the fixes
> into svn/trunk and the OSG-3.0 branch.   In both cases these were bugs
> and in the case of  OcclusionQueryNode it will have resulted in a GL
> resource leak and potential errors on closing and opening contexts.
>
> There is chance that amongst the hundreds of warnings there are some
> other genuine bugs lurking but with so many false positives it's hard
> to spot them.  For the 3.0.0 release I'll now do any further
> investigation into the clang results/testing with clang as I've
> probably got the most out of it in the time available.
>
> Robert.
>

Thanks for looking into this!

Yeah, the version of Clang in Ubuntu is too old to be useful. 2.9 is enough
to build OSG trunk with those patches, and I"ve been using trunk myself.

Eventually, I'd suggest doing a build with CMAKE_CXX_FLAGS set to:

-Wall -Wextra -Wno-overloaded-virtual -Wno-unused-parameter

This will disable the vast majority of the "noise".

Here's the remaining ones I notice that seem possibly useful:

/home/rpavlik/src/third-party/osg-trunk/src/osgAnimation/Skeleton.cpp:25:87:
warning: addition of default argument on redeclaration makes this
constructor a copy constructor [-Wdefault-arg-special-member]
Skeleton::UpdateSkeleton::UpdateSkeleton(const UpdateSkeleton& us, const
osg::CopyOp& copyop= osg::CopyOp::SHALLOW_COPY) : osg::Object(us, copyop),
osg::NodeCallback(us, copyop)

          ^       ~~~~~~~~~~~~~~~~~~~~~~~~~
/home/rpavlik/src/third-party/osg-trunk/include/osgAnimation/Skeleton:34:13:
note: previous declaration was not a special member function
            UpdateSkeleton(const UpdateSkeleton&, const osg::CopyOp&);
            ^




/home/rpavlik/src/third-party/osg-trunk/src/OpenThreads/pthreads/PThread.cpp:1024:15:
warning: comparison of unsigned expression < 0 is always false
[-Wtautological-compare]
    if (cpunum<0) return -1;
        ~~~~~~^~



/home/rpavlik/src/third-party/osg-trunk/src/osgDB/ExternalFileWriter.cpp:221:122:
warning: expression result unused [-Wunused-value]
    _objects.insert(ObjectsSet::value_type(&obj,
ObjectData(absoluteDestinationPath, relativeDestinationPath,
written))).first;

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
^~~~~




/home/rpavlik/src/third-party/osg-trunk/src/osgManipulator/Dragger.cpp:175:18:
warning: using the result of an assignment as a condition without
parentheses [-Wparentheses]
        if (*itr = constraint) return;
            ~~~~~^~~~~~~~~~~~
/home/rpavlik/src/third-party/osg-trunk/src/osgManipulator/Dragger.cpp:175:18:
note: place parentheses around the assignment to silence this warning
        if (*itr = constraint) return;
                 ^
            (                )
/home/rpavlik/src/third-party/osg-trunk/src/osgManipulator/Dragger.cpp:175:18:
note: use '==' to turn this assignment into an equality comparison
        if (*itr = constraint) return;
                 ^
                 ==




/home/rpavlik/src/third-party/osg-trunk/src/osgManipulator/Dragger.cpp:187:18:
warning: using the result of an assignment as a condition without
parentheses [-Wparentheses]
        if (*itr = constraint)
            ~~~~~^~~~~~~~~~~~
/home/rpavlik/src/third-party/osg-trunk/src/osgManipulator/Dragger.cpp:187:18:
note: place parentheses around the assignment to silence this warning
        if (*itr = constraint)
                 ^
            (                )
/home/rpavlik/src/third-party/osg-trunk/src/osgManipulator/Dragger.cpp:187:18:
note: use '==' to turn this assignment into an equality comparison
        if (*itr = constraint)
                 ^
                 ==



-- 
Ryan Pavlik
HCI Graduate Student
Virtual Reality Applications Center
Iowa State University

[email protected]
http://academic.cleardefinition.com
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to