[cfe-dev] clang-tidy / static analysis

Jonas Toth via cfe-dev cfe-dev at lists.llvm.org
Sun Nov 12 12:50:24 PST 2017


clang-tidy seems to be the correct point to start. It is made to rewrite
source code and is easy to begin with.

Take a look into the clang-tools-extra repository and browse the code,
there are a lot of examples. There is a dedicated tutorial in the docs
to get started as well.

Am 12.11.2017 um 14:43 schrieb Maurizio Vitale via cfe-dev:
> hello clang clan,
>   I'm getting started with checkers and I have one in mind that I
> don't see a good way to implement.
> The idea is to find all uses of putenv and replace them w/ setenv.
> This requires analyzing the argument to discover constant parts in it
> (setenv require a separate variable name). It also require to check
> that the argument is not modified (or such modifications need also to
> be replaces w/ setenvs).
> Is there a way to use the fixit infrastructure together with the
> static analyzer?
> If so, is it possible to make multiple changes part of the same fixit?
> What would be the recommended way of proceeding in this case? any
> similar checks/analysis I can take a look at?
> Thanks a lot,
>        Maurizio
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> http://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/20171112/ff44dbd9/attachment.html>

More information about the cfe-dev mailing list