[cfe-dev] clang-tidy: identify "C++-code-specific-checks" and "C-Code-specific-checks"

Andi-Bogdan Postelnicu via cfe-dev cfe-dev at lists.llvm.org
Wed Sep 15 00:30:46 PDT 2021


Please see my comments inlined.

[1] https://clang-analyzer.llvm.org/available_checks.html
> On 15 Sep 2021, at 10:09, Oza, Hiral via cfe-dev <cfe-dev at lists.llvm.org> wrote:
> Greetings!
> We are using clang-tidy with single ‘config-file’ listing enabled tidy-checks to run for both “C++-code” and “C-code”.
> We are looking for your inputs:
> From list of supported clang-tidy checks, how to identify "C++-code-specific-checks" and which are "C-Code-specific-checks"? Can this be checked programmatically?
		What are you trying to achieve? clang-tidy addresses more C++ checkers, I don’t recall seeing C specific checkers and no, you cannot determine this programatically since it’s a matter of matching at the AST level.
> Are “clang-analyzer-“ checks only applied to C++-code?
	       No, there are a wide variaty of checkers that apply to C and C++ [1]
> What happens internally if C++-code-check ran on C-code? Will it skip parsing C-code?
		Nothing really, since the clang-tidy checkers are implemented mostly as matcher at the AST level and since specific nodes that are matched for a checkers are not present in the AST the checker will not get triggered.
> Thank you in advance for your valuable inputs.
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org <mailto:cfe-dev at lists.llvm.org>
> https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev <https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20210915/6ddf6d94/attachment.html>

More information about the cfe-dev mailing list