Pclint usage (2)

Source: Internet
Author: User

The legacy problems in pclint (1) have been solved.

 

Problem 1: Multiple lint C files

Method 1:

(1) Create prjlint under the lint Software Directory. LNT file. The first line of the file is the name of the lint configuration file used. From the second line, list all the lint files you want *. c file name, one row. If you want to output the result to a file, add a line "-OS (File Name)" (for example: "-OS (C:/lint/result.txt)") to the front )"). Example:

Yf_config.lnt

// The following is the. c file for lint,
G:/src/TT/tt1.c
G:/src/TT/tt2.c
...
(2) Add a "PC-LINT project" command in source insight, all settings are the same as "PC-LINT" settings, except for the text in the "run" edit box in the "Custom commands" dialog box by "C:/lint/LINT-NT.EXE filename. LNT % F "changed to" C:/lint/LINT-NT.EXE prjlint. lint ", that is, change the configuration file name to prjlint. LNT, and remove the unending "% F"

Method 2:

(1) Open sourceinsight, select options --> Custom commands --> Add, and enter pclint_prj.
(2) enter D:/unxutils/usr/local/wbin/find.exe % d-name * In run *. c-o-name *. CPP | D:/unxutils/usr/local/wbin/xargs D:/PC-Lint/lint-NT-I "d:/unxutils/usr/local"-U D: /PC-Lint/STD. lnt d:/PC-Lint/env-vc6.lnt

Problem 2: pclint checks the library header file

Method:

Add STD. LNT

-Wlib (0)

This parameter cancels the review of the compiler library file, which is a very important parameter. If
If you just want to review your code, add this parameter. Otherwise, the library functions of the compiler will also
For review.

 

Conclusion: after solving the problem above, check the application and find that the MIRSA-C standard in pclint8.0 is 1998, a total of 127. MIRSA-C standards are very strict, so check out a lot of problems, need to see the standard side modification.

 

References:

PC-lint and C/C ++ code quality http://dev.csdn.net/author/DL88250/ad095b3f77994a9ab2cfe3c695e3e004.html

The use of PC-Lint (a) "http://blog.csdn.net/scucj/archive/2009/08/05/4409735.aspx of which is more important: 2.2 PC-Lint introduction.

Linux PC-LintHttp://blog.csdn.net/robbie1314/archive/2010/06/21/5684927.aspx

Misra_c_1998 http://download.csdn.net/down/2072813/wkeliang.

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.