Sourcetrail | Sourcetrail - free and open-source interactive source
kandi X-RAY | Sourcetrail Summary
kandi X-RAY | Sourcetrail Summary
Sourcetrail is a free and open-source cross-platform source explorer that helps you get productive on unfamiliar source code.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of Sourcetrail
Sourcetrail Key Features
Sourcetrail Examples and Code Snippets
Community Discussions
Trending Discussions on Sourcetrail
QUESTION
I'm looking for a way to integrate clang-tidy
into a CI workflow, but the build system being used is MSBuild with dependencies managed by vcpkg in manisfest mode.
Is there some advanced command line that I can pass MSBuild (or some other tool that understands MSBuild process completely) to be able to generate compile_commands.json
?
I'm sure I'm not the first one to try that, I've seen a couple of cases of success using SourceTrail
and ClangPowerTools
, but it has been specially painful in my case because the alternatives cannot detect the include paths exposed by vcpkg.
ANSWER
Answered 2022-Jan-25 at 19:43It turns out that msbuild has a builtin target for clang-tidy since Visual Studio started to support that linter.
To invoke it one can run : msbuild /t:ClangTidy ...
.
Unfortunately, very few command line options are exposed from the clang-tidy integration to msbuild CLI: the list of checks, the header-filter, additional compiler options, a flag for warnings in system headers and the tool path.
If one wants to export the fixes file generated by clang-tidy, which was my case, it needs to do some extra work.
I achieved my goal by adding one Directory.Build.props
file in the project folder which overrides the path to the original clang-tidy.exe
with a batch script (.bat
), which does some preparation steps and forwards the msbuild target command line to a python script which can invoke clang-tidy with its full command line capabilities.
The props file:
QUESTION
How to use modern code analysis tools, such as SourceTrail on old-ish embedded c/c++ source code, originally for compilers such as Hi-Tech C, PIC C, IAR Workbench for a number of Microcontrollers not only limited to PIC, PIC16, and PIC18 series from Microchip.
In order to support the limited architectures of the tiny microcontrollers, the vendors of the embedded compilers have had to come up with extensions to the c/c++ language, which were (or are not yet) in the c language specifications.
This results in the microcontroller specific header files containing stuff like this:
...ANSWER
Answered 2020-Oct-09 at 15:29The fix below will enable c code to be understood by any compiler supporting the C18 or C2x specifications. I've not (yet) had the opportunity to test with c++, so they may not fully comply with any of the C++ specifications.
Thank you to people such as @Antti Haapala, @Clifford, and @anastaciu who answered my related questions here and here and enabled this more complete answer.
Theshort long
type
First, the 24-bit short long
type was a problem, as no equivalent exists in the c-specifications, and because the two words of the type could not be addressed with a #define
. At first, I used Perl to simply modify the string short long
into long
of all the vendor-specific header files like this:
QUESTION
I'm attempting to use SourceTrails (https://www.sourcetrail.com/) to analyze embedded c from the MPLAB CX8 compiler. It's not entirely trouble-free, as the compiler uses a number of custom features, not found in the C standard.
One of these is the use of short long
to indicate 24-bit variables in global includes, such as:
ANSWER
Answered 2020-Oct-09 at 08:53You can use something like:
QUESTION
I'm attempting to use Sourcetrail (https://www.sourcetrail.com/) to quickly get into some old embedded c/c++ source code for the pic18 series of microcontrollers.
I get errors when importing the hardware include files, which uses an exotic method to define the hardware address of the bit addressable hardware registers, such as the below from pic18f26k22.h
.
ANSWER
Answered 2020-Oct-06 at 10:39@ is not a valid token in C, so you cannot use it as a macro identifier either. The easiest solution would be to handle the @ address with a macro, i.e.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install Sourcetrail
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page