Ubuntu中C代码静态检查工具Splint的安装配置和使用
2013-01-25 17:48
811 查看
1、
从http://www.splint.org/download.html下载splint-3.1.2.src.tgz,存放到/home/spring/Splint文件夹下;
2、
打开终端;
3、
解压缩:tar zxvfsplint-3.1.2.src.tgz
4、
安装到/usr/local/splint目录下:
sudo mkdir /usr/local/splint
cd splint-3.1.2
./configure --prefix=/usr/local/splint
sudo apt-getinstall flex
make
sudo make install
5、
配置,打开当前的bash资源文件
vi ~/.bashrc
在文件最后加入:
exportLARCH_PATH=/usr/local/splint/share/splint/lib
exportLCLIMPORTDIR=/usr/local/splint/share/splint/imports
exportPATH=/usr/local/splint/bin:$PATH
退出文件
source~/.bashrc
测试:test.c
void fun()
{
int*p = NULL;
}
在终端输入 splint test.c
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 of
declaration to suppress message. (Use -varuse to inhibit warning)
Finished checking --- 1 code warning
参考文献:
1、 http://www.splint.org/
2、 http://blog.csdn.net/sunjiajiang/article/details/7368684
从http://www.splint.org/download.html下载splint-3.1.2.src.tgz,存放到/home/spring/Splint文件夹下;
2、
打开终端;
3、
解压缩:tar zxvfsplint-3.1.2.src.tgz
4、
安装到/usr/local/splint目录下:
sudo mkdir /usr/local/splint
cd splint-3.1.2
./configure --prefix=/usr/local/splint
sudo apt-getinstall flex
make
sudo make install
5、
配置,打开当前的bash资源文件
vi ~/.bashrc
在文件最后加入:
exportLARCH_PATH=/usr/local/splint/share/splint/lib
exportLCLIMPORTDIR=/usr/local/splint/share/splint/imports
exportPATH=/usr/local/splint/bin:$PATH
退出文件
source~/.bashrc
测试:test.c
void fun()
{
int*p = NULL;
}
在终端输入 splint test.c
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 of
declaration to suppress message. (Use -varuse to inhibit warning)
Finished checking --- 1 code warning
参考文献:
1、 http://www.splint.org/
2、 http://blog.csdn.net/sunjiajiang/article/details/7368684
相关文章推荐
- Ubuntu中C代码静态检查工具Splint的安装配置和使用
- C/C++代码静态检查工具Cppcheck在VS2008开发环境中的安装配置和使用
- C/C++代码静态检查工具PC-lint在VS2008开发环境中的安装配置和使用
- C/C++代码静态检查工具PC-lint在VS2008开发环境中的安装配置和使用
- C/C++代码静态检查工具Cppcheck在VS2013开发环境中的安装配置和使用
- C/C++代码静态检查工具Cppcheck在VS2008开发环境中的安装配置和使用
- C/C++代码静态检查工具Cppcheck在VS2008开发环境中的安装配置和使用
- C/C++代码静态检查工具Cppcheck在VS2008开发环境中的安装配置和使用
- C/C++代码静态检查工具Cppcheck在VS2008开发环境中的安装配置和使用
- 2017.4.18 静态代码分析工具sonarqube+sonar-runner的安装配置及使用
- Windows 64位机上C/C++代码静态检查工具Logiscope RuleChecker的安装和使用
- 2017.4.18 静态代码分析工具sonarqube+sonar-runner的安装配置及使用
- Windows 64位机上C/C++代码静态检查工具Logiscope RuleChecker的安装和使用
- 代码静态分析工具PC-LINT安装配置[转]
- 代码静态分析工具——splint的学习与使用
- 静态java代码检查工具-findbug使用简介
- 静态代码检查工具的使用(cppcheck)
- 阿里代码规范检查工具的安装使用
- linux 静态代码检测工具valgrind的安装及使用
- 静态代码检查工具 cppcheck 的使用