[clang-tools-extra] [clang-tidy] New option `CompilationArgsToRemoveRegex` to remove arguments from the command line (PR #111453)
Aaron Ballman via cfe-commits
cfe-commits at lists.llvm.org
Fri Nov 22 05:52:36 PST 2024
=?utf-8?q?FĂ©lix-Antoine?= Constantin
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/111453 at github.com>
AaronBallman wrote:
> I too have the feeling that this feature is a responsibility of the build system, not of clang-tidy. What do you think @AaronBallman ?
If I understand correctly, this situation is when CMake is configured for another compiler (e.g., GCC) but is also instructed to run clang-tidy, but then CMake hands clang-tidy the command line arguments it was handing to GCC, and clang-tidy is giving hard errors for the unknown command line arguments.
Clang itself ignores some unknown command line options while erring on others (it seems to be `-` vs `--` which decides this): https://godbolt.org/z/f1T8hjP69 Would it make sense for clang-tidy to follow suit and ignore unknown options specified with `-`? That would help in the modules case, but wouldn't help for the CUDA case mentioned in the issue.
CC @MaskRay @jansvoboda11 for additional opinions (and why does clang warn in some cases but err in others, is that intentional?)
https://github.com/llvm/llvm-project/pull/111453
More information about the cfe-commits
mailing list