[clang-tools-extra] [clang-tidy] New option `CompilationArgsToRemoveRegex` to remove arguments from the command line (PR #111453)
Fangrui Song via cfe-commits
cfe-commits at lists.llvm.org
Fri Nov 29 23:44:19 PST 2024
=?utf-8?q?FĂ©lix-Antoine?= Constantin
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/111453 at github.com>
MaskRay wrote:
> I think the regex solution might be brittle/not clean from a user perspective, with potential for a small amount of maintenance. Instead, I would also suggest a flag to error, warn, or silence these, defaulting to a warning.
>
> Using `compile_commands.json` from a build configured for another compiler should provide a good experience.
>
> * problem: `--flag` is not known to Clang, but would enable some part through a macro define -> missed analysis of important part of the code base?
> * fine: `--other` is not known to Clang, but also not important to analysis because it does something during code-gen, etc.
>
> The `--flag` example is why I'd be a bit worried about fully silencing these unknown flags, instead of a downgrade to a warning.
Second this. The option can ignore certain driver errors (unknown argument).
https://github.com/llvm/llvm-project/pull/111453
More information about the cfe-commits
mailing list