Re: [Bf-committers] PVS-Studio Static Analysis

2012-04-25 Thread trouble daemon
Interesting problem you have here. While I don't understand all the errors themselves per se, I did take a look at the root web page and a few samples of reports, along with a glimpse at the html it generated. My initial thought would be some sort of regex like parser that would be very similar in

Re: [Bf-committers] PVS-Studio Static Analysis

2012-04-25 Thread Campbell Barton
On Thu, Apr 26, 2012 at 9:16 AM, Jason Wilkins wrote: > p.s., not that I'm against annotating false positives in source code > (or better yet, rewriting in a less suspicious manner).  I do not > believe in forcing programmers to do things.  However, if we ever > wanted to require that Blender ship

Re: [Bf-committers] PVS-Studio Static Analysis

2012-04-25 Thread Campbell Barton
While its probably possible to setup some `good enough` solution using diff, I tend to agree with Jason - that you need something more comprehensive so some minor edits to a file doesn't give you a lot of changes to the diff to read through that are in fact only line number change or re-ordered fun

Re: [Bf-committers] PVS-Studio Static Analysis

2012-04-25 Thread Jason Wilkins
p.s., not that I'm against annotating false positives in source code (or better yet, rewriting in a less suspicious manner). I do not believe in forcing programmers to do things. However, if we ever wanted to require that Blender ship with zero warning flags from these kinds of tools there is goi

Re: [Bf-committers] PVS-Studio Static Analysis

2012-04-25 Thread Jason Wilkins
If the source line changes then diff isn't a good enough tool. What is needed is a that these programs need to maintain a database that keeps a signature of each problem that is basically an AST of the area affected and is independent of source line and whitespace changes. Then you could annotate

Re: [Bf-committers] PVS-Studio Static Analysis

2012-04-25 Thread Mr Rasmus Lerchedahl Petersen
> Running a second time gives you only the false positives again. > If some new bug is added to the source you still needed to read over > the false positives (unless your memory is really good). > > long term we need to have a way to notify us when new errors are added. Sounds like a job for diff?

Re: [Bf-committers] PVS-Studio Static Analysis

2012-04-25 Thread Jason Wilkins
I thought that he had his own tool viva64 that PVS-Studio was based on. I do not really want to argue politics, but I have no problem with the fact that he has added value by integrating it with VS and then released it without source. He honestly may not have even modified clang that much and is

Re: [Bf-committers] PVS-Studio Static Analysis

2012-04-25 Thread Lockal S
I should mention that PVS-Studio contains clang for C++ parsing and preprocessing. As far I can see they have reimplemented some of the clang features (missing in vc++) and have added their own diagnosis patterns. The main feature is visual studio integration, which allows to enable/disable diagnos

Re: [Bf-committers] PVS-Studio Static Analysis

2012-04-24 Thread Campbell Barton
for obvious things they mostly find the same issues (even same false positives), but each have a handful that are unique. I've ran blender through cppcheck, splint, sparse and clang-static-checler. the problem is that once you wade through the error logs (mainly false positives), and fixed the act

Re: [Bf-committers] PVS-Studio Static Analysis

2012-04-24 Thread Jason Wilkins
The "Uncreated file" is a false alarm. The value of file_ is initialized by another member function. Probably not the most clear way to write the code, but not an error. I already contacted viva64 to suggest they tighten up that part of their analysis. On Tue, Apr 24, 2012 at 8:15 PM, Jason Wil

Re: [Bf-committers] PVS-Studio Static Analysis

2012-04-24 Thread Jason Wilkins
Oh, the way it is written now is confusing I think, since it does several no-ops. Wouldn't UINT_MAX be better? On Tue, Apr 24, 2012 at 8:11 PM, Erwin Coumans wrote: > You are looking at the code that I fixed yesterday, see my commit message > for details here: > http://lists.blender.org/pipermai

Re: [Bf-committers] PVS-Studio Static Analysis

2012-04-24 Thread Erwin Coumans
You are looking at the code that I fixed yesterday, see my commit message for details here: http://lists.blender.org/pipermail/bf-blender-cvs/2012-April/045090.html >>V610 Undefined behavior. Check the shift operator '<<. The left operand '(~0)' is negative. extern_bullet btquantizedbvh.h 82 ~(0

Re: [Bf-committers] PVS-Studio Static Analysis

2012-04-24 Thread Jason Wilkins
This line in btQuantizedBvh.h confuses me: int getTriangleIndex() const { btAssert(isLeafNode()); unsigned int x=0; unsigned int y = (~(x&0))<<(31-MAX_NUM_PARTS_IN_BITS); // Get only the lower bits where the triangle index

Re: [Bf-committers] PVS-Studio Static Analysis

2012-04-24 Thread Jason Wilkins
I'm working through them and fixing what Clang did not catch. I was going to say the same thing as Nicholas, code analysis is such a wide open field with virtually infinite number of things you can check for, that having more than one tool is a good idea. On Tue, Apr 24, 2012 at 6:30 PM, Nicholas

Re: [Bf-committers] PVS-Studio Static Analysis

2012-04-24 Thread Nicholas Bishop
Not necessarily; different static analyzers can detect different types of potential problems. The PVS analysis contains some interesting things like the "Misprint in a homogeneous code block" section that I don't think clang's analyzer does. On Tue, Apr 24, 2012 at 7:20 PM, Tom M wrote: > We have

Re: [Bf-committers] PVS-Studio Static Analysis

2012-04-24 Thread Tom M
We have a page with generated CLang static analysis, http://clang.blenderheads.org/trunk/ It probably shows the same bugs as PVS-Studio does. LetterRip On Tue, Apr 24, 2012 at 4:15 PM, Nicholas Bishop wrote: > I think some of these have been fixed already in recent commits from Campbell. > > O

Re: [Bf-committers] PVS-Studio Static Analysis

2012-04-24 Thread Nicholas Bishop
I think some of these have been fixed already in recent commits from Campbell. On Tue, Apr 24, 2012 at 7:11 PM, Jason Wilkins wrote: > http://www.viva64.com/en/b/0145/#ID0EO3BK > > It appears that Andrey Karpov has done an analysis of Blender source > code using his PVS-Studio tool.  He did this