zoukankan      html  css  js  c++  java
  • PCLint 帮助中关于如何获得gcc/g++编译宏定义和头文件搜索目录的方法说明

    /* co-gcc.lnt: This is the seed file for configuring Lint for use with
    GCC versions 2.95.3 and later.

    Like all compiler options files this file is intended to be used
    as follows:

    lint co-gcc.lnt source-files-to-be-linted

    Some of the information that co-gcc.lnt requires needs to be
    furnished with the help of the gcc system itself.

    If any of these directions are unclear, you may gain a better insight
    into what is happening by checking the file gcc-readme.txt

    For C, first create an empty file named empty.c and then
    run the command (options are case sensitive):

    gcc -E -dM empty.c >lint_cmac.h

    This will capture macro definitions in a file that will be included
    automatically at the beginning of each module by use of the -header
    option within co-gcc.lnt. The macros may change as you change
    compiler options so that ultimately you may want to incorporate
    this step into a make facility.

    Next we need to determine the search directories. If you run

    gcc -c -v empty.c

    you will see among other things this coveted list. For example you
    might get:

    ...
    #include "..." search starts here
    #include <...> search starts here
    /usr/local/include
    /usr/lib/gcc/i686-apple-darwin8/4.0.1/include
    /usr/include
    /System/Library/Frameworks
    /Library/Frameworks
    End of search list.
    ...

    For each directory shown (there are five in the list above) prefix
    the directory name by a "--i" and place it in a file whose name is,
    say, include.lnt. You may then begin linting programs by using the
    command

    lint co-gcc.lnt include.lnt source-files

    Note: it is conventional to place both .lnt files into a single .lnt
    file called std.lnt

    For C++, run the command (options are again case sensitive):

    g++ -E -dM empty.c >lint_cppmac.h

    This will capture C++ macro definitions in a file that will be
    included automatically at the beginning of each C++ module
    at the request of co-gcc.lnt.

    Next we need to determine C++ search directories. If you run

    g++ -c -v empty.c

    As in the case of C you should prepend a --i onto each directory
    displayed and place these options into a file such as include.lnt.
    Again, there is nothing sacred about the name and if you intend to
    do mixed C and C++ programming it will be necessary for you to use
    a differently named file. The rest proceeds as before.

    Note, some options in this file (such as the size options, i.e. -sp4
    indicating that pointers are four bytes wide) may need to be changed.
    See "System Dependent Options" below.
    */

  • 相关阅读:
    oracle的wm_concat()方法与的排序问题,Oracle的 listagg 函数
    sql sever 常用的存储过程的写法或者说与Oracle中存过的异同点
    Oracle游标的使用
    oracle与sql sever的财务月份归属的问题
    sql sever使用习惯
    sqlsever 的存储过程的调试
    sql sever与Oracle的异同点
    单例模式
    线程 ---- 锁(生产者、消费者)
    IO 流理解实例
  • 原文地址:https://www.cnblogs.com/dongzhiquan/p/2733002.html
Copyright © 2011-2022 走看看