clang's scan-build doesn't work for simple cpp file

后端 未结 1 1630
悲&欢浪女
悲&欢浪女 2021-02-15 20:12

I can\'t get clang\'s c++-analyzer to work on a toy C++ file.

#include 

using namespace std;

int main()
{
    int t[4];
    int x,         


        
1条回答
  •  太阳男子
    2021-02-15 20:35

    Here's the reason:

    http://lists.cs.uiuc.edu/pipermail/cfe-dev/2010-September/011194.html

    >>> When I run "clang --analyze" on my c++ source files individually I get reports,
    >>> but none when using the scan-build tool.
    >> 
    >> This is intended behavior.  C++ support is still alpha and so it isn't enabled
    >> by default in scan-build.  It's really only intended to be used by those
    >> currently hacking on the analyzer.
    >> 
    >> If you want to enable C++ analysis, you must define the environment variable
    >> CCC_ANALYZER_CPLUSPLUS.
    

    0 讨论(0)
提交回复
热议问题