Skip to content

The test results are different when installing clang-query-10 using apt and pip for the project. #102

@tomchon

Description

@tomchon

i want using clang-query to do Static Code Analysis. but i find some different and funny things. The test results are different when installing clang-query-10 using apt and pip method in the project. The only difference is the path used for clang-query.

  1. using pip install
    It will install the clang-tools into /usr/local/bin/
pip3 install clang-tools 
clang-tools --install 10 --tool  clang-query   --directory  /usr/local/bin/

test result in match :

 root@dc9a644c9793: /usr/local/bin/clang-query-10 TDengine/debug/compile_commands.json TDengine/community/source/dnode/vnode/src/tsdb/tsdbRead2.c -f TDengine/community/tests/ci/filter_for_return_values 

0 matches.
  1. apt install
    It will install the clang-tools into /usr/bin/
apt install clang-tools-10
root@dc9a644c9793:/home/chr/clang_scan_result/20240812154233#  /usr/bin/clang-query-10 -p TDengine/debug/compile_commands.json TDengine/community/source/dnode/vnode/src/tsdb/tsdbRead2.c -f TDengine/community/tests/ci/filter_for_return_values
In file included from TDengine/community/source/dnode/vnode/src/tsdb/tsdbRead2.c:17:
In file included from TDengine/community/source/dnode/vnode/src/inc/tsdb.h:22:
In file included from TDengine/community/include/util/tsimplehash.h:19:
In file included from TDengine/community/include/util/tarray.h:19:

Match #1:
TDengine/community/source/dnode/vnode/src/tsdb/tsdbRead2.c:5831:7: note: "root" binds here
      tsdbUnrefMemTable(pTsdb->mem, pSnap->pNode, true);  // unref the previous refed mem
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Match #2:

TDengine/community/source/dnode/vnode/src/tsdb/tsdbRead2.c:5848:7: note: "root" binds here
      tsdbUnrefMemTable(pTsdb->mem, pSnap->pNode, true);  // unref the previous refed mem
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Match #3:
TDengine/source/dnode/vnode/src/tsdb/tsdbRead2.c:5852:7: note: "root" binds here
      tsdbUnrefMemTable(pTsdb->imem, pSnap->pINode, true);
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3 matches.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions