From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

CVI Static analysis

Hi Guys

 

I am trying to work out how to use a 3rd party static analysis tool (Parasoft C++ Test) the CVI Compiler 2012. The parasoft tool is Eclipse based and we use it for our other build environments.

 

The tool has a 2 stage process.

  1. Build the source code to ensure that it is sane.

  2. Run the analyzer based upon the makefile / project file.

 

I know that the CVI compiler can be run from the command line (there is a thread on this forum) and so I may be able to convince Eclipse to use a makefile to build the code with the CVI compiler toolchain which would allow the Static analyser tool to then run using the makefile as it's source.

 

Questions.

 

1. Has anybody ever tried this before ?

2. I know that the CVI compiler is specific to NI. but does anybody know if it is using an open source toolchain as it's base (such as cygwin etc). I have found the define /LEAM_AND_MEAN in the prj file which I know is use in a number of compilers.

3. Has anybody else used a static analysis tool within CVI.

 

There is anther thread from 2010 about this, but with no sucess at the end of the thread, so I am asking the question from a different angle.

 

Thanks in advance

 

Steve

 

0 Kudos
Message 1 of 4
(3,198 Views)

CVI uses it's own propreitary compiler, and not using an open source toolchain. The command line compiler for CVI was looked at for this before, but it essentialy a windowless version of the compiler in the environment and is used primarily for automated builds. When I have looked at this in the past for the Klockwork analysis tool, we determined that the CVI compiler did not offer the necessary hooks to make it work.

 

However, CVI does support third-party compilers and we did have success with the clang compiler which installs with CVI. Clang is a pretty popular compiler, so I bet you can find a lot of support for using that with most static analysis tools.

National Instruments
0 Kudos
Message 2 of 4
(3,183 Views)

Thanks for the reply.

 

I am interested in the command line version of the compiler as I may be able to convince eclipse to use a makefile to process the build using the CVI compiler as the toolchain, and if this is the case then I can probably get my static analyzer tool to work, well that's the plan.

 

Do you have any example build scripts from an automated CVI build ?

 

 

 

 

0 Kudos
Message 3 of 4
(3,175 Views)

You can find some info on using the CVI compiler from the command line here. But you will find that there are not a whole lot of options for it. It is essentially the same thing as building inside the environment. You cannot use it with a makefile and it does not provide any intermediate output. That is why I recommend using the Clang compiler instead. This will be much easier to integrate with your static analysis tool as the compiler toolchain.

National Instruments
0 Kudos
Message 4 of 4
(3,149 Views)