Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Test and Performance Tools Platform (TPTP) » C++ Static analysis does not works
C++ Static analysis does not works [message #79522] Wed, 02 August 2006 12:20 Go to next message
Eclipse UserFriend
Originally posted by: divis1969.mail.ru

Hi,

I've installed TPTP 4.2.0.1, C++ Code Review Provider and tried to analayze
my C++ project.
It does not find any problems, but I suppose it is not because the code is
clean :-)
I've specifically edited one of the source files to add a explicit
vioalation of the rule (it was Declaring->Avoid declaring multiply variables
in single statement). But analysis shows 0 violations again!

What might be the problem with it?

I did not tried Java rules. Also, I've noticed that
Preferencies->Analysis->Custom rules you cannot add category for C++ rules.
The only top-level category is Code Review for Java

I'm using Eclipse 3.2, CDT 3.1.0

Dmitry
Re: C++ Static analysis does not works [message #80020 is a reply to message #79522] Mon, 07 August 2006 21:31 Go to previous messageGo to next message
Randy D. Smith is currently offline Randy D. SmithFriend
Messages: 394
Registered: July 2009
Senior Member
Dmitry Smirnov wrote:
> Hi,
>
> I've installed TPTP 4.2.0.1, C++ Code Review Provider and tried to analayze
> my C++ project.
> It does not find any problems, but I suppose it is not because the code is
> clean :-)
> I've specifically edited one of the source files to add a explicit
> vioalation of the rule (it was Declaring->Avoid declaring multiply variables
> in single statement). But analysis shows 0 violations again!
>
> What might be the problem with it?
>
> I did not tried Java rules. Also, I've noticed that
> Preferencies->Analysis->Custom rules you cannot add category for C++ rules.
> The only top-level category is Code Review for Java
>
> I'm using Eclipse 3.2, CDT 3.1.0
>
> Dmitry

Does too!!

Sorry, it's just that my experience is different from yours, so the
"does not work" title grates on my nerves a bit! :-)

If this is the first time you've tried any of the static analysis, you
might have been bitten by what, too me, is an inappropriate default
setting. Check your Analysis... launch configuration (Run=>Analysis...
from the main menu, or the Launch=>Analysis... toolbar button with the
bar chart icon on it, or the right-click Analysis=>Analysis... from the
Navigator window) ... see the Scope tab is up front by default? Click
the Rules tab instead... by default you'll see *no* rules selected.

I just added another comment suggesting that "all rules for a given
language" be the default setting here in my "kitchen sink" bugzilla on
Static Analysis usability, bug 152911 <
https://bugs.eclipse.org/bugs/show_bug.cgi?id=152911 >.

Try clicking on the "Code Review for C/C++" checkbox to enable all rules
and see if that fixes it.


If it's not that simple pilot error... how about this one... how did you
install TPTP itself? I know that the C/C++ rules, being a "Tech Preview
add-on", has to be installed "manually", but my experience is that
people trying to install TPTP outside of a Callisto Discovery Site
Update/Install quite often get bitten by the fact that that need EMF/XSD
installed as well. If the above didn't work, make sure TPTP itself is
installed correctly. That means, if you installed it manually, that you
need to look at the "Requirements" section at the bottom of the TPTP
download page.

As to the last item, I'd have to concur that it doesn't look like
customization of the C/C++ rules is at the same level as for Java. That
may have already been remedied, as I know Steve's been working hard
post-4.2.0.1 on static analysis overall, and there have been significant
new contributions as well. When I get around to checking the new 4.2.1
stuff out, I'll let you know if that appears to be fixed yet or not.

--
RDS

Randy D. Smith randy (dot) d (dot) smith (at) intel (dot) com
Eclipse TPTP Committer, Platform Proj (data collection/agent controller)
Re: C++ Static analysis does not works [message #80035 is a reply to message #79522] Mon, 07 August 2006 21:56 Go to previous messageGo to next message
Randy D. Smith is currently offline Randy D. SmithFriend
Messages: 394
Registered: July 2009
Senior Member
Dmitry Smirnov wrote:
> Hi,
>
> I've installed TPTP 4.2.0.1, C++ Code Review Provider and tried to analayze
> my C++ project.
> It does not find any problems, but I suppose it is not because the code is
> clean :-)
> I've specifically edited one of the source files to add a explicit
> vioalation of the rule (it was Declaring->Avoid declaring multiply variables
> in single statement). But analysis shows 0 violations again!
>
> What might be the problem with it?
>
> I did not tried Java rules. Also, I've noticed that
> Preferencies->Analysis->Custom rules you cannot add category for C++ rules.
> The only top-level category is Code Review for Java
>
> I'm using Eclipse 3.2, CDT 3.1.0
>
> Dmitry

One other thing... make sure it is the 4.2.0.1 RELEASED version of the
C++ Code Reviewer you're using with the 4.2.0.1 TPTP runtime... when I
just tried with the 4.2.1 latest build (200608041327) of those rules
(which take you from 10 rules to 43) I get a NullPointerException
whether with the 4.2.0.1 TPTP runtime or the TPTP runtime of that same
build... I'll file a bugzilla.

--
RDS

Randy D. Smith randy (dot) d (dot) smith (at) intel (dot) com
Eclipse TPTP Committer, Platform Proj (data collection/agent controller)
Re: C++ Static analysis does not works [message #80096 is a reply to message #80035] Tue, 08 August 2006 12:29 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: s_gutz.ca.ibm.com

Randy D. Smith wrote:
> Dmitry Smirnov wrote:
>> Hi,
>>
>> I've installed TPTP 4.2.0.1, C++ Code Review Provider and tried to
>> analayze my C++ project.
>> It does not find any problems, but I suppose it is not because the
>> code is clean :-)
>> I've specifically edited one of the source files to add a explicit
>> vioalation of the rule (it was Declaring->Avoid declaring multiply
>> variables in single statement). But analysis shows 0 violations again!
>>
>> What might be the problem with it?
>>
>> I did not tried Java rules. Also, I've noticed that
>> Preferencies->Analysis->Custom rules you cannot add category for C++
>> rules. The only top-level category is Code Review for Java
>>
>> I'm using Eclipse 3.2, CDT 3.1.0
>>
>> Dmitry
>
> One other thing... make sure it is the 4.2.0.1 RELEASED version of the
> C++ Code Reviewer you're using with the 4.2.0.1 TPTP runtime... when I
> just tried with the 4.2.1 latest build (200608041327) of those rules
> (which take you from 10 rules to 43) I get a NullPointerException
> whether with the 4.2.0.1 TPTP runtime or the TPTP runtime of that same
> build... I'll file a bugzilla.
>

We have recently found a number of minor bugs related to specific C++
rules but in general the 43 rules currently available in 4.2.1 builds
should be fine. I'll see if we can reproduce this one and correct it if
necessary.

I'd recommend a 4.2.1 build rather than 4.2.0.1 because it already
includes a number of defect corrections.

Steve
Re: C++ Static analysis does not works [message #80623 is a reply to message #80096] Fri, 11 August 2006 16:38 Go to previous messageGo to next message
Randy D. Smith is currently offline Randy D. SmithFriend
Messages: 394
Registered: July 2009
Senior Member
Steve Gutz wrote:
> Randy D. Smith wrote:
>
>> Dmitry Smirnov wrote:
>>
>>> Hi,
>>>
>>> I've installed TPTP 4.2.0.1, C++ Code Review Provider and tried to
>>> analayze my C++ project.
>>> It does not find any problems, but I suppose it is not because the
>>> code is clean :-)
>>> I've specifically edited one of the source files to add a explicit
>>> vioalation of the rule (it was Declaring->Avoid declaring multiply
>>> variables in single statement). But analysis shows 0 violations again!
>>>
>>> What might be the problem with it?
>>>
>>> I did not tried Java rules. Also, I've noticed that
>>> Preferencies->Analysis->Custom rules you cannot add category for C++
>>> rules. The only top-level category is Code Review for Java
>>>
>>> I'm using Eclipse 3.2, CDT 3.1.0
>>>
>>> Dmitry
>>
>>
>> One other thing... make sure it is the 4.2.0.1 RELEASED version of the
>> C++ Code Reviewer you're using with the 4.2.0.1 TPTP runtime... when I
>> just tried with the 4.2.1 latest build (200608041327) of those rules
>> (which take you from 10 rules to 43) I get a NullPointerException
>> whether with the 4.2.0.1 TPTP runtime or the TPTP runtime of that same
>> build... I'll file a bugzilla.
>>
>
> We have recently found a number of minor bugs related to specific C++
> rules but in general the 43 rules currently available in 4.2.1 builds
> should be fine. I'll see if we can reproduce this one and correct it if
> necessary.
>
> I'd recommend a 4.2.1 build rather than 4.2.0.1 because it already
> includes a number of defect corrections.
>
> Steve

I ran into a variety of problems, including the one mentioned here
(getting no results when there obviously should be results). Based on
interactions via the bugzilla I submitted, I've learned that it's
essential that the project being analyzed be "known" as a C/C++ project.
That's *not* the way I was wanting to use the static analysis... I'd
like to run it on several separate projects from a CVS repository all
checked out under one umbrella project... but I think, again based on
the interactions via that bugzilla, that we might see that in a
subsequent release.

So, if necessary, create a new C/C++ project, and bring the code you
want to analyze into that project. Worked for me.

--
RDS

Randy D. Smith randy (dot) d (dot) smith (at) intel (dot) com
Eclipse TPTP Committer, Platform Proj (data collection/agent controller)
Re: C++ Static analysis does not works [message #81295 is a reply to message #79522] Mon, 21 August 2006 16:40 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: divis1969.mail.ru

Of course, I've checked the C++ Rules on Scope tab.
I've installed the TPTP manually, but I've also installed the EMF/XSD
(2.2.0).
My project is C++.
I've installed TPTP and C++ rules from the same page of TPTP download and I
suppose they have the same version.

I'm not sure what has helped me. Just couple hours ago, I've downloaded TPTP
4.2.0.2( platform SDK only, but I had to disable all the staff except
platform since it requires BIRT), C++ rules 4.2.0.2, installed them all,
created C++ managed make project, created C++ file with main function and
added just some staff to trigger the rule to fail (declaration int a, b,
c;). I've created new analysis configuration for just this test project.

Fortunately, analyzer has found that violation!

But what was the problem is unknown..

Thanks all for help!

Dmitry



"Dmitry Smirnov" <divis1969@mail.ru> wrote in message
news:eaq5an$4vv$1@utils.eclipse.org...
> Hi,
>
> I've installed TPTP 4.2.0.1, C++ Code Review Provider and tried to
> analayze my C++ project.
> It does not find any problems, but I suppose it is not because the code is
> clean :-)
> I've specifically edited one of the source files to add a explicit
> vioalation of the rule (it was Declaring->Avoid declaring multiply
> variables in single statement). But analysis shows 0 violations again!
>
> What might be the problem with it?
>
> I did not tried Java rules. Also, I've noticed that
> Preferencies->Analysis->Custom rules you cannot add category for C++
> rules. The only top-level category is Code Review for Java
>
> I'm using Eclipse 3.2, CDT 3.1.0
>
> Dmitry
>
Re: C++ Static analysis does not works [message #81325 is a reply to message #81295] Mon, 21 August 2006 17:02 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: divis1969.mail.ru

Well, something still wrong.
It looks like analyzing of C files does not works. If the wrong code is
located in the file named foo.c, analyzer unable to detect violation.
Does it parse C++ files only?

Dmitry


"Dmitry Smirnov" <divis1969@mail.ru> wrote in message
news:eccnli$svs$1@utils.eclipse.org...
> Of course, I've checked the C++ Rules on Scope tab.
> I've installed the TPTP manually, but I've also installed the EMF/XSD
> (2.2.0).
> My project is C++.
> I've installed TPTP and C++ rules from the same page of TPTP download and
> I suppose they have the same version.
>
> I'm not sure what has helped me. Just couple hours ago, I've downloaded
> TPTP 4.2.0.2( platform SDK only, but I had to disable all the staff except
> platform since it requires BIRT), C++ rules 4.2.0.2, installed them all,
> created C++ managed make project, created C++ file with main function and
> added just some staff to trigger the rule to fail (declaration int a, b,
> c;). I've created new analysis configuration for just this test project.
>
> Fortunately, analyzer has found that violation!
>
> But what was the problem is unknown..
>
> Thanks all for help!
>
> Dmitry
>
>
>
> "Dmitry Smirnov" <divis1969@mail.ru> wrote in message
> news:eaq5an$4vv$1@utils.eclipse.org...
>> Hi,
>>
>> I've installed TPTP 4.2.0.1, C++ Code Review Provider and tried to
>> analayze my C++ project.
>> It does not find any problems, but I suppose it is not because the code
>> is clean :-)
>> I've specifically edited one of the source files to add a explicit
>> vioalation of the rule (it was Declaring->Avoid declaring multiply
>> variables in single statement). But analysis shows 0 violations again!
>>
>> What might be the problem with it?
>>
>> I did not tried Java rules. Also, I've noticed that
>> Preferencies->Analysis->Custom rules you cannot add category for C++
>> rules. The only top-level category is Code Review for Java
>>
>> I'm using Eclipse 3.2, CDT 3.1.0
>>
>> Dmitry
>>
>
>
Re: C++ Static analysis does not works [message #81339 is a reply to message #81325] Mon, 21 August 2006 17:30 Go to previous messageGo to next message
Steve Gutz is currently offline Steve GutzFriend
Messages: 70
Registered: July 2009
Member
It should parse C files as well. If it doesn't it's a bug.


"Dmitry Smirnov" <divis1969@mail.ru> wrote in message
news:eccovf$478$1@utils.eclipse.org...
> Well, something still wrong.
> It looks like analyzing of C files does not works. If the wrong code is
> located in the file named foo.c, analyzer unable to detect violation.
> Does it parse C++ files only?
>
> Dmitry
>
>
> "Dmitry Smirnov" <divis1969@mail.ru> wrote in message
> news:eccnli$svs$1@utils.eclipse.org...
>> Of course, I've checked the C++ Rules on Scope tab.
>> I've installed the TPTP manually, but I've also installed the EMF/XSD
>> (2.2.0).
>> My project is C++.
>> I've installed TPTP and C++ rules from the same page of TPTP download and
>> I suppose they have the same version.
>>
>> I'm not sure what has helped me. Just couple hours ago, I've downloaded
>> TPTP 4.2.0.2( platform SDK only, but I had to disable all the staff
>> except platform since it requires BIRT), C++ rules 4.2.0.2, installed
>> them all, created C++ managed make project, created C++ file with main
>> function and added just some staff to trigger the rule to fail
>> (declaration int a, b, c;). I've created new analysis configuration for
>> just this test project.
>>
>> Fortunately, analyzer has found that violation!
>>
>> But what was the problem is unknown..
>>
>> Thanks all for help!
>>
>> Dmitry
>>
>>
>>
>> "Dmitry Smirnov" <divis1969@mail.ru> wrote in message
>> news:eaq5an$4vv$1@utils.eclipse.org...
>>> Hi,
>>>
>>> I've installed TPTP 4.2.0.1, C++ Code Review Provider and tried to
>>> analayze my C++ project.
>>> It does not find any problems, but I suppose it is not because the code
>>> is clean :-)
>>> I've specifically edited one of the source files to add a explicit
>>> vioalation of the rule (it was Declaring->Avoid declaring multiply
>>> variables in single statement). But analysis shows 0 violations again!
>>>
>>> What might be the problem with it?
>>>
>>> I did not tried Java rules. Also, I've noticed that
>>> Preferencies->Analysis->Custom rules you cannot add category for C++
>>> rules. The only top-level category is Code Review for Java
>>>
>>> I'm using Eclipse 3.2, CDT 3.1.0
>>>
>>> Dmitry
>>>
>>
>>
>
>
Re: C++ Static analysis does not works [message #81367 is a reply to message #81339] Tue, 22 August 2006 12:34 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: divis1969.mail.ru

Could somebody check that analyzing of the C files do really work?
Note: I'm working on Windows, file was created in Eclipse
(File->New->Source) and filename has lovercase .c

Dmitry

"Steve Gutz" <sgutz@ca.ibm.com> wrote in message
news:eccqjh$csj$1@utils.eclipse.org...
> It should parse C files as well. If it doesn't it's a bug.
>
>
> "Dmitry Smirnov" <divis1969@mail.ru> wrote in message
> news:eccovf$478$1@utils.eclipse.org...
>> Well, something still wrong.
>> It looks like analyzing of C files does not works. If the wrong code is
>> located in the file named foo.c, analyzer unable to detect violation.
>> Does it parse C++ files only?
>>
>> Dmitry
>>
>>
>> "Dmitry Smirnov" <divis1969@mail.ru> wrote in message
>> news:eccnli$svs$1@utils.eclipse.org...
>>> Of course, I've checked the C++ Rules on Scope tab.
>>> I've installed the TPTP manually, but I've also installed the EMF/XSD
>>> (2.2.0).
>>> My project is C++.
>>> I've installed TPTP and C++ rules from the same page of TPTP download
>>> and I suppose they have the same version.
>>>
>>> I'm not sure what has helped me. Just couple hours ago, I've downloaded
>>> TPTP 4.2.0.2( platform SDK only, but I had to disable all the staff
>>> except platform since it requires BIRT), C++ rules 4.2.0.2, installed
>>> them all, created C++ managed make project, created C++ file with main
>>> function and added just some staff to trigger the rule to fail
>>> (declaration int a, b, c;). I've created new analysis configuration for
>>> just this test project.
>>>
>>> Fortunately, analyzer has found that violation!
>>>
>>> But what was the problem is unknown..
>>>
>>> Thanks all for help!
>>>
>>> Dmitry
>>>
>>>
>>>
>>> "Dmitry Smirnov" <divis1969@mail.ru> wrote in message
>>> news:eaq5an$4vv$1@utils.eclipse.org...
>>>> Hi,
>>>>
>>>> I've installed TPTP 4.2.0.1, C++ Code Review Provider and tried to
>>>> analayze my C++ project.
>>>> It does not find any problems, but I suppose it is not because the code
>>>> is clean :-)
>>>> I've specifically edited one of the source files to add a explicit
>>>> vioalation of the rule (it was Declaring->Avoid declaring multiply
>>>> variables in single statement). But analysis shows 0 violations again!
>>>>
>>>> What might be the problem with it?
>>>>
>>>> I did not tried Java rules. Also, I've noticed that
>>>> Preferencies->Analysis->Custom rules you cannot add category for C++
>>>> rules. The only top-level category is Code Review for Java
>>>>
>>>> I'm using Eclipse 3.2, CDT 3.1.0
>>>>
>>>> Dmitry
>>>>
>>>
>>>
>>
>>
>
>
Re: C++ Static analysis does not works [message #81474 is a reply to message #81367] Wed, 23 August 2006 09:46 Go to previous message
Eclipse UserFriend
Originally posted by: s_gutz.ca.ibm.com

Hi Dmitry,

Yes this is on my list of things to do, but with everyone around me on
vacation this week, I am buried.

BTW with regard to creating custom C++ rules from the preference page.
There are currently no rule templates for C++. When we add some of
these it will be possible to create custom rules.

Keep in mind that the C/C++ code review is in preview right now. This
means that bugs and feature work for the core analysis framework and
Java take precedence.

Steve



Dmitry Smirnov wrote:
> Could somebody check that analyzing of the C files do really work?
> Note: I'm working on Windows, file was created in Eclipse
> (File->New->Source) and filename has lovercase .c
>
> Dmitry
>
> "Steve Gutz" <sgutz@ca.ibm.com> wrote in message
> news:eccqjh$csj$1@utils.eclipse.org...
>> It should parse C files as well. If it doesn't it's a bug.
>>
>>
>> "Dmitry Smirnov" <divis1969@mail.ru> wrote in message
>> news:eccovf$478$1@utils.eclipse.org...
>>> Well, something still wrong.
>>> It looks like analyzing of C files does not works. If the wrong code is
>>> located in the file named foo.c, analyzer unable to detect violation.
>>> Does it parse C++ files only?
>>>
>>> Dmitry
>>>
>>>
>>> "Dmitry Smirnov" <divis1969@mail.ru> wrote in message
>>> news:eccnli$svs$1@utils.eclipse.org...
>>>> Of course, I've checked the C++ Rules on Scope tab.
>>>> I've installed the TPTP manually, but I've also installed the EMF/XSD
>>>> (2.2.0).
>>>> My project is C++.
>>>> I've installed TPTP and C++ rules from the same page of TPTP download
>>>> and I suppose they have the same version.
>>>>
>>>> I'm not sure what has helped me. Just couple hours ago, I've downloaded
>>>> TPTP 4.2.0.2( platform SDK only, but I had to disable all the staff
>>>> except platform since it requires BIRT), C++ rules 4.2.0.2, installed
>>>> them all, created C++ managed make project, created C++ file with main
>>>> function and added just some staff to trigger the rule to fail
>>>> (declaration int a, b, c;). I've created new analysis configuration for
>>>> just this test project.
>>>>
>>>> Fortunately, analyzer has found that violation!
>>>>
>>>> But what was the problem is unknown..
>>>>
>>>> Thanks all for help!
>>>>
>>>> Dmitry
>>>>
>>>>
>>>>
>>>> "Dmitry Smirnov" <divis1969@mail.ru> wrote in message
>>>> news:eaq5an$4vv$1@utils.eclipse.org...
>>>>> Hi,
>>>>>
>>>>> I've installed TPTP 4.2.0.1, C++ Code Review Provider and tried to
>>>>> analayze my C++ project.
>>>>> It does not find any problems, but I suppose it is not because the code
>>>>> is clean :-)
>>>>> I've specifically edited one of the source files to add a explicit
>>>>> vioalation of the rule (it was Declaring->Avoid declaring multiply
>>>>> variables in single statement). But analysis shows 0 violations again!
>>>>>
>>>>> What might be the problem with it?
>>>>>
>>>>> I did not tried Java rules. Also, I've noticed that
>>>>> Preferencies->Analysis->Custom rules you cannot add category for C++
>>>>> rules. The only top-level category is Code Review for Java
>>>>>
>>>>> I'm using Eclipse 3.2, CDT 3.1.0
>>>>>
>>>>> Dmitry
>>>>>
>>>>
>>>
>>
>
>
Previous Topic:Automated GUI Recorder HELP
Next Topic:Re: Automated GUI Tests
Goto Forum:
  


Current Time: Fri Apr 26 11:16:36 GMT 2024

Powered by FUDForum. Page generated in 0.03636 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top