-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[core/clib] Clang-Tidy Clazy warnings #7422
Comments
Hello @ferdymercury! Can you explain us how you got these warning, so we can reproduce the warnings and try to address them? |
Hi! I get these warnings when using QtCreator: Clang-tidy defaults enable the security analyzer: Behind the scenes, it calls something like:
|
Thanks! Especially for the the |
I finally learned how to reproduce these kind of warnings with a new version of the LLVM tools. You need to make sure that the relevant ROOT subdirectory is compiled with For example, if you want to scan the diff --git a/interpreter/llvm-project/llvm/CMakeLists.txt b/interpreter/llvm-project/llvm/CMakeLists.txt
index 0b046717ba..b685291490 100644
--- a/interpreter/llvm-project/llvm/CMakeLists.txt
+++ b/interpreter/llvm-project/llvm/CMakeLists.txt
@@ -283,7 +283,7 @@ list(INSERT CMAKE_MODULE_PATH 0
# Generate a CompilationDatabase (compile_commands.json file) for our build,
# for use by clang_complete, YouCompleteMe, etc.
-set(CMAKE_EXPORT_COMPILE_COMMANDS 1)
+set(CMAKE_EXPORT_COMPILE_COMMANDS 0)
option(LLVM_INSTALL_BINUTILS_SYMLINKS
"Install symlinks from the binutils tool names to the corresponding LLVM tools." OFF)
diff --git a/math/CMakeLists.txt b/math/CMakeLists.txt
index 543adbf6b1..12f5930901 100644
--- a/math/CMakeLists.txt
+++ b/math/CMakeLists.txt
@@ -4,6 +4,10 @@
# For the licensing terms see $ROOTSYS/LICENSE.
# For the list of contributors see $ROOTSYS/README/CREDITS.
+set(CMAKE_EXPORT_COMPILE_COMMANDS 1)
+
add_subdirectory(mathcore)
if(mathmore)
add_subdirectory(mathmore) Then, after building, you go into equivalent subdirectory in the build directory (e.g. run-clang-tidy -checks='clang-analyzer-*' . -j20 So the warnings are easy to reproduce and we are aware that these exist for all for ROOT in general. Therefore, I'd suggest to close this particular issue so that we can focus on feature development and fixing confirmed bugs. We can't afford separate GitHub issues for all groups of Thank you very much @ferdymercury for the initiative thought! We learned a lot from this! |
The text was updated successfully, but these errors were encountered: