Closed kayasemih closed 1 year ago
Hello @semihkaya0941,
there is a default set of checks enabled when you run Clang-Tidy, you can find them in the log listed under Enabled checks:
when you run the tool.
We currently working on a patch to enable more checks.
In the meantime, it is possible to use the --run-clang-tidy-options
option to enable additional Clang-Tidy Checks (full list of available checks is here).
e.g.: idf.py clang-check --run-clang-tidy-options="-checks=bugprone-undefined-memory-manipulation,readability-avoid-const-params-in-decls"
will also run the following checks:
This might enable you to run a suitable check to detect the memory leak, but I am not 100% sure about it. Maybe the leak was not detected because of other reasons.
IDF version.
v4.4.4
Espressif SoC revision.
ESP32-D0WD-V3 (revision 3)
Operating System used.
MacOS
How did you build your project?
Command line with idf.py
IDE being used
VS Code IDE
Build System
CMake
Development Kit.
ESP32 WROVER-IE on Custom Board
The error I intentionally made on esp-idf's own sample project in the directory I specified is as follows;
/esp/esp-idf/examples/cxx/experimental/esp_modem_cxx/main/simple_client.cpp
I have attached the
warning.txt
file generated when I run the project byidf.py clang-check
.warnings.txt
Logging is as follows;
The situation I noticed is that
IDF Clang-Tidy
does not do a bad job between 30-40 LOC. But it doesn't notice memory leaks, which I would expect it to notice in slightly more complex projects. Is this some kind of bug? How can it be used more effectively? Please correct me if I'm wrong, I intend to use any static code analyzer to alert me to bugs I'm not noticing and areas where I need to be careful. If it can't do its job, there is no point in using it. You mentioned earlier thatIDF Clang-Tidy
is still under development. I appreciate your efforts, but as a user, can we conclude that it is not ready for use yet?main.zip