美文网首页C/C++
代码静态分析工具——splint的学习与使用

代码静态分析工具——splint的学习与使用

作者: 一木之夏 | 来源:发表于2017-09-12 10:50 被阅读15次

    splint的学习与使用:

    http://www.cnblogs.com/bangerlee/archive/2011/09/07/2166593.html


    # 提示没有找到头文件,通过-I参数把目录加进来splint -I "E:\C_workspace\demo\sipApp_tkj\include" Call.cpp

    splint的安装:

    Splint should compile effortlessly on standard Unix systems, and with a bit of effort on non-Unix platforms.  If you produce a port for a non-Unix platform, please letsplint@cs.virginia.eduknow.

    To build Splint you need:

    a (hopefully ANSI-conforming) C compiler.  GNUgccis recommended, but most modern C compilers should work.

    make, the GNU make utility. If you don't havemakeinstalled on your system, download it fromftp.gnu.org.

    standard Unix tools:gzip,tar

    Instructions:

    1.Downloadhttp://www.splint.org/downloads/splint-3.1.1.tgz(the latest stable release).

        Copy this package to the directory where you want to build Spint.  When the tar file is extracted, it will create a splint-3.1.1 subdirectory.

    2.tar xzf splint-3.1.1.src.tgz(extract files from the archive)

    3.cd splint-3.1.1(enter the extracted directory)

    4.configure

        This will create a Makefile with settings for your system.  Useconfigure --prefix=directoryif you want to install  Splint in prefix directorydirectory.

    5.make

        GNU's make utility is required; it may be namedgmakeorgnumakeon your system.  It is best to do this in an emacs shell or a buffered terminal,  so you can scroll through the output.

        This builds Splint.  While it is building, subscribe to the splint-announce mailing list by visiting http://www.splint.org/lists.html

        If the build was successful, it then runs the test suite.  You should see:

    Testing splint 3.1.1...Version Info:Splint 3.1.1 --- 11 Feb 2002Maintainer: splint-bug@splint.org... (about 100 lines of test output elided)Checking manual...Checking tests2.2...Checking tests2.4...Checking tests2.5...Checking db1...Checking db2...Checking db3...

        Examine the test output. If there are errors, send a bug report tosplint-bug@cs.virginia.edu.

        Note: If possible do not built splint in a directory under /usr/.  If the test suite is run in a directory under /usr/ for example /usr/src/, it will report errors even if Splint was built correctly.

        The remaining steps are only necessary if you want to install the Splint binary and libraries in a different directory (set when you ran configure).

    6.make install

    7.Set environment variables:

        LARCH_PATH- path to search for splint libraries and initializations files. If you are using the standard directories, this should be.:base-directory/splint-3.1.1/lib.

        LCLIMPORTDIR- directory containing lcl imports files. If you are using the standard directories, this isbase-directory/splint-3.1.1/imports.

    Put the commands to set these variables (the actual commands will depend on the shell you are using) in one of your initialization dotfiles (usually~/.environment).

    Set up your PATH to include the directory containingsplint-3.1.1/bin/splint, or move the binary to a directory on your command path.

    相关文章

      网友评论

        本文标题:代码静态分析工具——splint的学习与使用

        本文链接:https://www.haomeiwen.com/subject/kttcsxtx.html