Tools: pclint configuration under VC6.0 and SourceInsight,

Source: Internet
Author: User

Tools: pclint configuration under VC6.0 and SourceInsight,

1. Introduction to lint

Lint is one of the most famous C language tools. It is a static code analysis developed by Bell Laboratory SteveJohnson at 1979 on the basis of PCC (PortableC Compiler), which is generally provided by UNIX systems. Compared with most C language compilers, lint can perform more extensive Error Analysis on programs and is a more rigorous compilation tool. Initially, the lint tool was used to scan the C source file and warn against unportable code in the source program. But now most lint utilities have become more rigorous, which not only checks portability problems, in addition, we can check out the features that are portable and fully compliant with the syntax but are likely to be incorrect. Pclint is the lint under winodws (this text is from Baidu encyclopedia)

Ii. pclint configuration under VC6.0

If you want to configure it from the beginning, you need to download a pclint installer and make various configurations during the installation process. If you want to quickly complete the configuration, use this link (http://download.csdn.net/detail/dyx1024/7812529), because it is configured on my machine, download it, unzip it, and then follow the steps below to complete the configuration can be used directly.

1. Download this link (lint.rar in the http://download.csdn.net/detail/dyx1024/7812529 plugin, unzip to the c drive (of course, you can put it on any disk, but then you have to modify the path in the configuration file ).

2. Open the C: \ lint \ std. lnt file and modify the path-I "D: \ Program Files \ Microsoft Visual Studio \ VC98 \ Bin" to your VC installation path.

3. Open VC6.0, select Tools ---> Customize... --> tools to create an item named pclint, and enter

"Command" entry: C:/lint/lint-nt.exe
"Argument" entry:-u C:/lint/std. lnt C:/lint/env-vc6.lnt "$ (FilePath )"

Then tick the Use Output Window, for example:


4. In the menu bar Tools of VC6.0, A pclint option is added. After opening a VC project, you can use this option to perform static code analysis on a single C/C ++ file, for example:


3. pclint configuration under sourceInsight:

1. Open SourceInsight, select Options --> Custom Commands --> Add, and enter pclint.
2. In Run, enter: C:/lint-nt-uC:/lint/std. lnt C:/lint/env-vc6.lnt % f


3. You do not need to enter the Dir field. Check the Iconic Window, Capture Output, and Parse Links in OutPut options and select the File and then Line options.
4. Click Menu... on the right ..., in the pop-up interface, select Work in the drop-down box Menu (you can also select another Menu), select <end of menu> in the Menu Cotents below, and click Insert on the right.


5. You can view the newly created pclint under the work menu of Source Insight, open any Source file of the project to be analyzed, and run pclint to perform static code analysis. For example



How to integrate PCLint in Source Insight

After the command is finished, check and check whether the result of the command line is normal.

However, the result of PC-Lint should be in the same directory of the PC-Lint executable files, that is, under your F: \ IDE \ lint, with a file folder like result, and files like result.txt will be output.
 
VC compilation can be integrated into Sourceinsight

Integrate VC compilation into Sourceinsight
Because I prefer sourceinsight and VC (Version 6.0), I cannot bear the IDE code tour function of VC after I get used to sourceinsight. So I flipped through the help of sourceinsight, there are a lot of treasures in it, but it is a pity that it will not be used, and there are no books or materials to introduce:-(, reading help sometimes gets dizzy), after a flip, integrate the compilation function of VC into sourceinsight. (If the VC debugging function is added to this multi-NB, haha, it is impossible. SI is just a super-professional code browser, regardless of debugging ).

Let's get down to the truth.

Basic Configuration:

PC + OS (Windows) + sourceinsight (www.sourceinsight.com) + VC6.0 (I only tried VC6.0)

Step:

1. Run sourceinsight and select Options ==> Custom commands...

The M commands dialog box appears.

A) In the Command: drop-down list box, select Build Project.

B) enter msdev % o. dsp/make in the Run: edit box.

C) Select Iconic Window and Capture Output in the Output group.

D) Select Save Files First in the Control group.

E) Select Parse Links in Output, File, and then line in Source Links in Output.

F) content of the Pattern Editing box: ^ \ ([a-zA-Z]. * \) (\ ([0-9] [0-9] * \). * <= (default, usually not changed)

2. Add the following items to your environment variables:

Example:

User variables of david

Bytes -----------------------------------------------------------------------------------------

Variable value

Bytes -----------------------------------------------------------------------------------------
Include

Bytes -----------------------------------------------------------------------------------------

Lib

Bytes -----------------------------------------------------------------------------------------

MSDevDir

Bytes -----------------------------------------------------------------------------------------

Path

Other ...... remaining full text>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.