llvm / llvm/llvm-project

clang-tidy ignoring compilation database compiler options when single check specified.

Open
#169,602 11 comments 0 reactions 0 assignees View on GitHub
clang-tidy
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

I have a strange issue with clang-tidy. For one specific file, running with our default .clang-tidy picks up two warnings, one of which is `performance-for-range-copy`. If I re-run with the following command, a bunch of `clang-diagnostic-format-security` errors are flagged:

`clang-tidy-21 --header-filter='-*' --checks='-*,performance-for-range-copy' -p= `

The compile_commands.json entry for the files *does* include `-no-format-security`!

Is there a way to see the commands passed to clang under the hood?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.