在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):Tencent/TscanCode开源软件地址(OpenSource Url):https://github.com/Tencent/TscanCode开源编程语言(OpenSource Language):C++ 99.1%开源软件介绍(OpenSource Introduction):TscanCodeA fast and accurate static analysis solution for C/C++, C#, Lua codesTencent is pleased to support the open source community by making TscanCode available. Copyright (C) 2017-2022 Tencent company and TscanCode Team. All rights reserved. IntroductionTscanCode is devoted to help programmers to find out code defects at the very beginning.
Highlights in v2.15.02 (2022-04-28)
Highlights in v2.15.01 (2022-01-19)
Highlights in v2.14.24 (2018-02-24)
For other changes please refer to change log. CompilingAny C++11 compiler should work. For compilers with partial C++11 support it may work. If your compiler has the C++11 features that are available in Visual Studio 2015 then it will work. If nullptr is not supported by your compiler then this can be emulated using the header lib/cxx11emu.h. There are multiple compilation choices:
Visual StudioUse the tsancode.sln file. The file is configured for Visual Studio 2015, but the platform toolset can be changed easily to older or newer versions. The solution contains platform targets for both x86 and x64. Select option g++ or clang++Simple build (no dependencies): make Usage at a glanceThis simple example contains a potential null pointer defect. Checking if p is null indicates that p might be null, so dereferencing p // func.cpp
void func(int* p) {
if(p == NULL) {
printf("p is null!");
}
printf("p is %d", *p);
} Run TscanCode: ./tscancode --xml func.cpp 2>result.xml Error list, result.xml: <?xml version="1.0" encoding="UTF-8"?>
<results>
<error file="func.cpp" line="7" id="nullpointer" subid="dereferenceAfterCheck" severity="error"
msg="Comparing [p] to null at line 3 implies [p] might be null. Dereferencing null pointer [p]." />
</results> There are more examples: For now, codes under trunk are only for TscanCode |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论