Install, configure, and use the C-code static check tool splint in Ubuntu

Source: Internet
Author: User

1,
Slave;

2,
Open the terminal;

3,
Extract: Tar zxvfsplint-3.1.2.src.tgz

4,
Install it in the/usr/local/splint directory:

Sudo mkdir/usr/local/splint

CD splint-3.1.2

./Configure -- prefix =/usr/local/splint

Sudo apt-getinstall flex

Make

Sudo make install

5,
Configuration to open the current bash resource file

VI ~ /. Bashrc

Add at the end of the file:

Exportlarch_path =/usr/local/splint/share/splint/lib

Exportlclimportdir =/usr/local/splint/share/splint/imports

Exportpath =/usr/local/splint/bin: $ path

Exit File

Source ~ /. Bashrc

 

Test: Test. c

Void fun ()

{

Int * P = NULL;

}

Enter splint test. C on the terminal

Splint 3.1.2 --- 25 Jan 2013

 

Test. C: (in function fun)

Test. C: 3: 7: Variable P declared but notused

Avariable is declared but never used. Use/* @ unused @ */In front

Declaration to suppress message. (use-varuse to inhibit warning)

 

Finished checking --- 1 code warning

 

 

References:

1,
Http://www.splint.org/

2,
Http://blog.csdn.net/sunjiajiang/article/details/7368684

 

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.