Issue 82314
Summary clang-tidy marks as error compile flag -static-libasan [clang-diagnostic-error]
Labels clang-tidy
Assignees
Reporter h1laryz
    Hi, I am using gcc/g++ as compilers in my projects, but also I want to use .clang-tidy as static analyzer.
While building I am getting an error

error: unknown argument '-static-libasan'; did you mean '-static-libsan'? [clang-diagnostic-error]
14068 warnings and 1 error generated.

How can I disable this warning in .clang-tidy?
Here is my .clang-tidy file:
Checks: >
bugprone-,
cppcoreguidelines-,
modernize-,
performance-,
-cppcoreguidelines-avoid-magic-numbers,
-cppcoreguidelines-pro-bounds-array-to-pointer-decay,
-cppcoreguidelines-pro-type-reinterpret-cast,
-cppcoreguidelines-pro-type-vararg,
-modernize-use-trailing-return-type,
readability-magic-numbers,
google-runtime-int,
misc-,
clang-analyzer-,

WarningsAsErrors: '*'
HeaderFilterRegex: 'a^'
FormatStyle: file


this from CMakeLists.txt getting an error during compilation. Because clang-tidy says it is an error.
Clangd I am using for vim/vscode and it also says that this -static-libasan flag is unknown, but actually this flag comes from a third_party library.

set_target_properties(
${PROJECT_NAME} PROPERTIES
CXX_CLANG_TIDY "${CLANG_TIDY_EXECUTABLE}"
)

![изображение](https://github.com/llvm/llvm-project/assets/71406854/eee4fd02-ed71-49e3-8382-446434b2b1ec)

How can I disable this error in .clang-tidy checks?
I tried to add something like this:
-clang-diagnostic-unknown-argument,
-no-unknown-warning-option,
-unknown-argument,

but it didn't help at all.

_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to