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

后端 未结 0 1418
我寻月下人不归
我寻月下人不归 2021-02-15 20:19

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,         


        
回答
  •  深忆病人
    2021-02-15 20:57

    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)
提交回复
热议问题