Skip to main content
Filter by
Sorted by
Tagged with
Tooling
0 votes
5 replies
94 views

I want to develop a tool that helps in transforming a code like this: #ifdef MYLIB_ENABLE_DEPRECATED_CODE ... some deprecated code ... #endif into: #ifdef MYLIB_ENABLE_DEPRECATED_CODE ...
Hari's user avatar
  • 1,985
-3 votes
1 answer
73 views

I'm trying QT Creator's Clang-Tidy interface. The documentation suggests I'll see something usable and aesthetically appealing, like this: The reality is a vomit of command-line output, like this: ...
John Perry's user avatar
  • 2,712
1 vote
1 answer
328 views

I'm using spdlog with fmt::format_string to log messages, and I also want to capture the call location using std::source_location. My goal is to have a simple logging function like this: Logger::Error(...
ATOM's user avatar
  • 59
0 votes
0 answers
98 views

Not exactly sure how to title this nicely. I've got a large CMake project that is targeting the MSVC compiler with Ninja build files. I'd like to integrate Clang-Tidy to analyze our code but am ...
Derek C.'s user avatar
  • 1,026
1 vote
1 answer
94 views

Running clang-tidy v19 on Ubuntu 24.04 $ clang-tidy-19 --version Ubuntu LLVM version 19.1.7 Generated a compile_commands.json: has 2 entries in it: [ { "arguments": [ "/usr/...
JohnA's user avatar
  • 899
2 votes
1 answer
165 views

Consider the following code: #include <string> auto f1(auto&& v) { return v; } auto f2(auto&& v) { return std::forward<decltype(v)>(v); } int main() { return ...
xmllmx's user avatar
  • 44.6k
0 votes
0 answers
85 views

Here is my .clang-tidy: Checks: > clang-analyzer-*, bugprone-*, cppcoreguidelines-*, misc-*, performance-*, portability-*, cert-*, -fuchsia-*, -llvm-header-guard, -hicpp-*, -...
Venelin's user avatar
  • 3,344
1 vote
1 answer
63 views

I am writing a module of clang-tidy, which finds declarations of variables with the necessary condition and perform FixItHint:CreateReplacement() for them. I found VarDecl, which defined via a strange ...
Umrikhin Vasiliy's user avatar
2 votes
1 answer
225 views

Consider the following program: #include <array> int main() { throw std::logic_error("hi"); } With some C++ compilers (or rather, standard libraries) - this compiles. For example,...
einpoklum's user avatar
  • 137k
0 votes
0 answers
55 views

I'm using Trunk in VS Code to run clang-tidy as a linter for my C++ project. When I run: trunk check I can see clang-tidy running in the output, and it does find issues: ... ... ... 10:2 medium ...
Itay Shalev's user avatar
3 votes
2 answers
102 views

I have code using container_of macros to get parent structure pointer from inner structure pointer. However, it triggers the clang-tidy security.ArrayBound warning. For instance the following code #...
shodanex's user avatar
  • 15.5k
0 votes
1 answer
91 views

My IDE is running clang-tidy (v20) on my C++ code. I have an enum where one of the identifiers is isnt_owning. And - clang tidy complains about the typo. <sarcasm>Thanks a bunch! I'll go right ...
einpoklum's user avatar
  • 137k
1 vote
0 answers
81 views

I've got the below piece of code that causes a warning with clang-tidy. void process(const std::vector<uint8_t> &buffer) { // ... process the message ... } void process(std::vector<...
Caglayan Dokme's user avatar
1 vote
1 answer
88 views

I would like to use Clang-Tidy to lint my Cmake QT project, which I develop in QTCreator. It is a C++ project that uses Pybind11 to interface with Python code. Unfortunately, running Clang-tidy from ...
Tyler Shellberg's user avatar
5 votes
2 answers
474 views

When I have a C++ lambda that captures an object by value, and that object can throw an exception in its copy constructor, clang-tidy will show a warning: warning: an exception may be thrown in ...
oliver's user avatar
  • 6,890
0 votes
0 answers
389 views

I'm trying to use clang-tidy with readability-identifier-naming fix to change the naming style in a small project, i.e. I want to rename multiple symbols across multiple files. For some reason clang-...
w128's user avatar
  • 4,978
3 votes
1 answer
107 views

I would like to write a clang-tidy check that finds field declarations with copy initialization (ICIS_CopyInit) and can change them into direct list initializations (ICIS_ListInit). There is a way to ...
Benjamin Bihler's user avatar
1 vote
1 answer
874 views

I would like to use the misc-include-cleaner check from clang-tidy in my codebase, but unfortunately, the <windows.h> header used throughout WinAPI conflicts with IWYU philosophy. Technically, I ...
Pavel T.'s user avatar
2 votes
1 answer
75 views

I would like to write a clang-tidy check that adds an lvalue ref qualifier to certain C++ methods. I have managed to detect the methods to fix, but I have troubles finding the right source location to ...
Benjamin Bihler's user avatar
0 votes
1 answer
86 views

my C++ code has calls to classes such as std::ifstream to open a file for reading or std::filesystem methods that iterate over directories or check if a file exists - I intend to abstract these away ...
lielb's user avatar
  • 41
0 votes
0 answers
71 views

When ever I include windows.h when writing C, the analyzer would give me a thousand errors , I could just simply ignore them but the problem is that it won't detect any problem in the code I write I ...
abdelrahman Mohamed's user avatar
2 votes
2 answers
334 views

I wanted to know if there is any compiler option or clang-tidy checks for this situation: #include<iostream> #include <ostream> int glob = 12; int& test(int d){ std::cout <<...
Ahmad Mansoori's user avatar
0 votes
1 answer
85 views

In my Memory.hpp file, I have a namespace boolean named isMHinit: namespace Memory { static bool isMHInit = false; DWORD HookFunction(LPVOID pTarget, LPVOID pDetour, LPVOID pTrampoline, BOOL ...
Surasia's user avatar
  • 27
1 vote
1 answer
171 views

I try to match all expressions that call to std::sort, so I wrote code like this Unfortunately, the check function of this class is not called. I also tried AddMatcher code like this: but it still ...
Yun Zuo's user avatar
  • 11
0 votes
1 answer
1k views

I am trying to create a CI/CD pipeline in gitlab that builds my project in the first stage and uses clang-tidy to run static analysis in the second stage. I soon realized that clang-tidy uses the ...
Dhruv Dighrasker's user avatar

1
2 3 4 5
10